Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2017-07-30, 21:04


Quin







Wiek: 25
Na forum: 4537 dni
Posty: 79

Piwa: 3

Respekt: 38

Siemka, mam problem ze skryptem gdy? powinien on teleportowa? czwarty pojazd kt?ry wje?d?a do cuboidu gdzie powinny by? w cuboidzie maksymalnie trzy auta ale nie dzia?a.
Dlatego zwracam si? do was.

M?j niedzia?aj?cy skrypt:

function amountvehicle element )
    local vehicleamount getElementsByType "vehicle" )
        if isElementWithinColShape(elementcuboidthen
            if vehicleamount 3 then
                setElementPosition element1777.8, -1815.313.5 )
                outputChatBox("Osi?gni?to maksimum pojazd?w!"element)
            end
        end
    end
end
addEventHandler("onColShapeHit"cuboidamountvehicle)


Ostatnio zmieniony przez Quin 2017-07-30, 22:09, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-30, 21:18


Hades.

Łiiiiiiiiii






Wiek: 22
Na forum: 4699 dni
Posty: 372
Nick w MP: Hades

Piwa: 3214

Respekt: 337,8
Respekt: 337,8Respekt: 337,8Respekt: 337,8



function amountvehicle element )
    local vehicleamount getElementsByType "vehicle" )
        if isElementWithinColShape(elementcuboidthen
            if vehicleamount 3 then
                setElementPosition element1777.8, -1815.313.5 )
                outputChatBox("Osi?gni?to maksimum pojazd?w!"element)
            end
        end
    end
end
addEventHandler("onColShapeHit"cuboidamountvehicle)


Podpis
Skrypty/Grafiki na zamówienie!
Kontakt: Discord R35#5507

Discord związany z pomocą: https://discord.gg/ttkQTsc
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-30, 22:10


Quin







Wiek: 25
Na forum: 4537 dni
Posty: 79

Piwa: 3

Respekt: 38

Nie dzia?a niestety.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-30, 22:19


Hades.

Łiiiiiiiiii






Wiek: 22
Na forum: 4699 dni
Posty: 372
Nick w MP: Hades

Piwa: 3214

Respekt: 337,8
Respekt: 337,8Respekt: 337,8Respekt: 337,8


function amountvehicle element )
    local vehicleamount getElementsByType "vehicle" )
        if isElementWithinColShape(elementcuboidthen
            if tonumber(vehicleamount) > 3 then
                setElementPosition element1777.8, -1815.313.5 )
                outputChatBox("Osi?gni?to maksimum pojazd?w!"element)
            end
        end
    end
end
addEventHandler("onColShapeHit"cuboidamountvehicle)


Podpis
Skrypty/Grafiki na zamówienie!
Kontakt: Discord R35#5507

Discord związany z pomocą: https://discord.gg/ttkQTsc
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-30, 22:24


amited







Wiek: 26
Na forum: 3714 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466


function amountvehicle element )
if element=="vehicle" then
 local vehicleamount getElementsWithinColShape(cuboid,"vehicle")
            if #vehicleamount > 3 then
local gracz=getVehicleController(element)
                setElementPosition element1777.8, -1815.313.5 )
                outputChatBox("Osi?gni?to maksimum pojazd?w!",gracz)
        end
    end
end
addEventHandler("onColShapeHit"cuboidamountvehicle)


[ Dodano: 2017-07-30, 22:31 ]
nie wiem czy to b?dzie dzia?a? na cuboid, jezeli nie to zrob zamiast niego colShape

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-30, 23:26


Quin







Wiek: 25
Na forum: 4537 dni
Posty: 79

Piwa: 3

Respekt: 38

Damian2511,amited, dalej nie dzia?a.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-30, 23:48


amited







Wiek: 26
Na forum: 3714 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

daj b??d z db3...

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-31, 00:13


Quin







Wiek: 25
Na forum: 4537 dni
Posty: 79

Piwa: 3

Respekt: 38

Brak b??d?w w twoim kodzie a w kodzie Damian2511 pokazuje si? amountvehicle.lua:11: attempt to compare number with nil

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-07-31, 00:35


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8


local cl createColCuboid(argumenty)

function amountvehicle element )
if getElementType(element) == "vehicle" then
 local vehicleamount getElementsWithinColShape(cl,"vehicle")
            if #vehicleamount and tonumber(#vehicleamount) > 3 then
local gracz=getVehicleController(element)
                setElementPosition element1777.8, -1815.313.5 )
                outputChatBox("Osi?gni?to maksimum pojazd?w!",gracz)
        end
    end
end
addEventHandler("onColShapeHit"clamountvehicle)


Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Quin
Wysłany: 2017-07-31, 00:36


.RiV







Wiek: 25
Na forum: 3588 dni
Posty: 554
Nick w MP: Split

Piwa: 2596

Respekt: 597,8
Respekt: 597,8

Sprawd? teraz

function amountvehicle element )
 local vehicleamount getElementsWithinColShape(source,"vehicle")
            if #vehicleamount >= 3 then
local veh getPedOccupiedVehicle(element)
                setElementPosition veh1777.8, -1815.313.5 )
                outputChatBox("Osi?gni?to maksimum pojazd?w!",element)
        end
    end
addEventHandler("onColShapeHit"cuboidamountvehicle)


Je?eli sprawdza ile pojazd?w jest w cuboidzie to po co kolejny raz sprawdza? element czy to na pewno pojazd :P

[ Dodano: 2017-07-31, 00:38 ]
Pan @up by? pierwszy :/

Podpis

Autor OGRPG, na scenie MTA od 2012 roku.




Użytkownik: 08.08.2016
GTAO Member: 06.02.2017
Support-Team: 17.06.2017 & 01.06.2019 - 18.11.2019
Moderator: 14.01.2018 - 09.08.2018

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Quin
Wysłany: 2017-07-31, 00:52


Quin







Wiek: 25
Na forum: 4537 dni
Posty: 79

Piwa: 3

Respekt: 38

marcin778,.WhiteBlue, obydwa kody dzia?aj?, wielkie dzi?ki! Temat do zamkni?cia.

Postaw piwo autorowi tego posta
 

 
Tagi: limit :: pojazdów :: cuboidzie
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Limit pojazdów w cuboidzie Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku