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

Wysłany: 2021-10-19, 00:23


etrnl

CLASSIC RPG






Wiek: 26
Na forum: 2199 dni
Posty: 86
Nick w MP: anonymous

Piwa: 57

Respekt: 50

Ostrzeżeń: 40%
Kod:




local zablokowane ={
['hydra'] = true,
['rhino'] = true,
['hunter'] = true,
['Trailer 1'] = true,
['Trailer 2'] = true,
['Trailer 3'] = true,
['Trailer 3'] = true,
['Box Freight'] = true,
['Box Freight'] = true,
}

function cv(plr, cmd, ...)
if getElementData(plr,"player:admin") ~= true then return end
if getElementData(plr, "player:level") == 4 or 3 then
if (not ...) then
outputChatBox("#FF0000* #FFFFFFPoprawne u?ycie: /cv <model>", plr,0,0,0,true)
return
end
local model = table.concat ( { ... }, " " )
if tonumber(model) ~= nil then
outputChatBox("#FF0000* #FFFFFFWpisz model a nie ID!", plr,0,0,0,true)
return end
local model = model:lower()
if zablokowane[model] then
outputChatBox("#FF0000* #FFFFFFTen pojazd jest zablokowany!", plr,0,0,0,true)
return end
local dim = getElementDimension(plr)
local int = getElementInterior(plr)
local x,y,z = getElementPosition(plr)
local r1,r2,r3 = getElementRotation(plr)
local model = getVehicleModelFromName(model)
if not model then outputChatBox("#FF0000* #FFFFFFNie ma takiego pojazdu!", plr,0,0,0,true) return end
local vehicle = getPedOccupiedVehicle(plr)
if getPedOccupiedVehicle(plr) then
outputChatBox("#FF0000* #FFFFFFNajpierw wysi?d? z pojazdu!", plr,0,0,0,true)
else
pojazd = createVehicle(model, x, y, z, r1, r2, r3)
setElementDimension(pojazd, dim)
setElementInterior(pojazd, int)
setElementPosition(plr,x, y, z+1.5)
warpPedIntoVehicle(plr, pojazd)
setVehiclePlateText(pojazd, "ZRESPIONY")
outputChatBox("#FF0000* #FFFFFFPojazd zosta? zrespiony!", plr,0,0,0,true)

function usuwam(plr,seat)
if seat ~= 0 then return end
destroyElement(source)
end
setTimer(usuwam,5000, 1)
addEventHandler("onVehicleExit", pojazd, usuwam)

end
end
end
addCommandHandler("cv", cv)



Jak poprawnie podpi?? timer na usuwanie auta? kmini? i kminie i nie moge wykmini?, ten nie dzia?a.

Przy okazji onPlayerQuit i onPlayerWasted jakby tu podpi?? pod respione?

Z g?ry dzi?ki, stawiam piwko za pomoc! :_)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-10-19, 23:22


xyzzz^

A nic






Wiek: 18
Na forum: 1993 dni
Posty: 319
Nick w MP: Aspyk21

Piwa: 308

Respekt: 81

Ostrzeżeń: 100%
daj eldate "respione" na te auto i dodaj sprawdzanie do tej funkcji i ?le wgl Timera u?ywasz


function usuwam(plrseat) 
if seat ~= 0 then return end
if getElementData(source'respiony'then
local v source
setTimer(function()
destroyElement (vend50001end
end
addEventHandler('onVehicleExit'rootusuwam


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
etrnl
Tagi: timer :: usuwanie :: auta
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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