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

Wysłany: 2015-02-05, 00:00


Daisu

Programista Lua






Wiek: 26
Na forum: 4444 dni
Posty: 193
SPONSOR
Nick w MP: Daisu

Piwa: 24

Respekt: 90

Witam mam startowe auta na spawnie i chcia?bym doda? komend? "respawn" kt?ra respawnowa?a by auta kt?e s? nieu?ywane mam taki skrypt na /setspawn ale chcia?bym ?eby nie respawnowa? wszystkich lecz tylko te kt?re by?y by zawarte w skrypcie.

main_s:




function respawn()
local accountname getAccountName (getPlayerAccount(source))
if isObjectInACLGroup "user." .. accountnameaclGetGroup "Respawn" ) ) then
outputChatBox("*** W ci?gu 15 sekund nast?pi respawn pojazd?w zachowaj ostro?no?? ***")
setTimer(function ()
local vehicles getElementsByType "vehicle" ) 
for kvehicle in ipairs vehicles ) do
if checkEmptyvehicle then
local seats getVehicleMaxPassengers(vehicle)
resetVehicleIdleTime vehicle respawnVehicle vehicle )
end
end
end150001)
end 
end
addEvent"respawn"true )
addEventHandler"respawn"getRootElement(), respawn )

function checkEmptyvehicle )
local passengers getVehicleMaxPassengersvehicle )
if typepassengers ) == 'number' then
for seat 0passengers do
if getVehicleOccupantvehicleseat then
return false
end
end
end
return true
end


function respawn1(thePlayercommand)
local xygetElementPosition(thePlayer)
local vehicle getPedOccupiedVehicle(thePlayer)
       if vehicle then
       local spawnVeh setVehicleRespawnPosition (vehiclexyz)
              if spawnVeh then
             outputChatBox("Spawn pojazdu ustawionio!"thePlayer) 
             else 
             outputChatBox("Error",thePlayer)
             end
     else
     outputChatBox("Najpierw wsiadz do pojazdu!"thePlayer)
     end
end
addCommandHandler("setspawn"respawn1)






main_c:



function triggerRespawn()
triggerServerEvent "respawn"getLocalPlayer() ) 
end
addCommandHandler"respawn"triggerRespawn )



Mety chyba nie musz? dawa? :)

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-02-05, 07:21


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4394 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3


Więcej informacji znajdziesz w Wikipedii MTA:

setElementData


Więcej informacji znajdziesz w Wikipedii MTA:

getElementData


Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-02-05, 08:59


PolskiSebek12

Programista






Wiek: 28
Na forum: 4346 dni
Posty: 343
Nick w MP: CrosRoad95

Piwa: 3883

Respekt: 288,8
Respekt: 288,8Respekt: 288,8Respekt: 288,8

Ostrzeżeń: 100%
widz? ?e robisz 1 podstawowy b??d. po stronie servera w funkcji kt?ra obs?uguje zdarzenie wszystkie: source, zamienie? na client oraz dodaj: if client == source then

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-02-05, 16:59


Wittx

8===D






Wiek: 26
Na forum: 4794 dni
Posty: 121
Nick w MP: wittula

Piwa: 1905

Respekt: 120
Respekt: 120

Po co kombinujecie?
Więcej informacji znajdziesz w Wikipedii MTA:

getElementsByType

Jako drugi argument podaj resourceRoot i po problemie.

Postaw piwo autorowi tego posta
 

 
Tagi: startowe :: auta :: ich :: restart.
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Startowe auta i ich restart. 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