Wysłany: 2017-11-22, 14:41
EvilXmik
Wiek: 28 Na forum: 3620 dni Posty: 148
Nick w MP: EvilXmik
Piwa : 399
Witam mam pytanko jak to zrobi? ?eby po czasie np. 30min usuwa?o te zrespione auto przez komende /p
Kod: addCommandHandler("p", function(plr, cmd, model)
local login = getAccountName ( getPlayerAccount ( plr ) )
if getElementData(plr, "duty") == 3 or getElementData(plr, "duty") == 2 or getElementData(plr, "duty") == 1 then
if (not model) then
outputChatBox("U?yj: /p <model>", plr)
return
end
local dim = getElementDimension(plr)
local x,y,z = getElementPosition(plr)
local r1,r2,r3 = getElementRotation(plr)
local model = getVehicleModelFromName(model)
if getPedOccupiedVehicle(plr) then
setElementModel(getPedOccupiedVehicle(plr), model)
setVehiclevopis("pojazd respiony")
else
local pojazd = createVehicle(model, x, y, z, r1, r2, r3)
warpPedIntoVehicle(plr, pojazd)
setElementDimension(pojazd, dim)
end
end
end)
Wysłany: 2017-11-23, 17:51
R3fr3Sh
Wiek: 27 Na forum: 4800 dni Posty: 70
Piwa : 60
Musisz doda? timera kt?ry usunie pojazd po 30 minutach. Je?li masz zamiar tworzy? du?o pojazd?w w ten spos?b mo?liwe ?e lepszy b?dzie timer kt?ry b?dzie sprawdza? co 5 minut czy pojazd nie jest starsze ni? 30 minut. Ale pierwsza opcja jest prostsza
else
local pojazd = createVehicle ( model , x , y , z , r1 , r2 , r3 )
warpPedIntoVehicle ( plr , pojazd )
setElementDimension ( pojazd , dim )
setTimer (function( veh ) if isElement ( veh ) then destroyElement ( veh ) end end , 1000 * 60 * 30 , 1 , pojazd )
end
Więcej szczegółów
Wystawiono 1 piw(a):EvilXmik
Wysłany: 2017-11-23, 18:41
EvilXmik
Wiek: 28 Na forum: 3620 dni Posty: 148
Nick w MP: EvilXmik
Piwa : 399
DB
ERROR: Loading script failed: Ff_Core/Admin_core/base.lua:76: ')' expected (to close '(' at line 50) near 'end'
Wysłany: 2017-11-23, 19:10
R3fr3Sh
Wiek: 27 Na forum: 4800 dni Posty: 70
Piwa : 60
Nie wrzuci?e? jakiego? enda za du?o? Ten kod mi si? ?aduje:
addCommandHandler ( "p" , function( plr , cmd , model )
local login = getAccountName ( getPlayerAccount ( plr ) )
if getElementData ( plr , "duty" ) == 3 or getElementData ( plr , "duty" ) == 2 or getElementData ( plr , "duty" ) == 1 then
if ( not model ) then
outputChatBox ( "U?yj: /p <model>" , plr )
return
end
local dim = getElementDimension ( plr )
local x , y , z = getElementPosition ( plr )
local r1 , r2 , r3 = getElementRotation ( plr )
local model = getVehicleModelFromName ( model )
if getPedOccupiedVehicle ( plr ) then
setElementModel ( getPedOccupiedVehicle ( plr ), model )
setVehiclevopis ( "pojazd respiony" )
else
local pojazd = createVehicle ( model , x , y , z , r1 , r2 , r3 )
warpPedIntoVehicle ( plr , pojazd )
setElementDimension ( pojazd , dim )
setTimer (function( veh ) if isElement ( veh ) then destroyElement ( veh ) end end , 1000 * 60 * 30 , 1 , pojazd )
end
end
end )
Więcej szczegółów
Wystawiono 1 piw(a):EvilXmik
Wysłany: 2017-11-23, 20:15
EvilXmik
Wiek: 28 Na forum: 3620 dni Posty: 148
Nick w MP: EvilXmik
Piwa : 399
okey ju? wszystko dzia?a dzi?ki za pomoc
Tagi: usuwanie :: pojazdu :: czasie
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: