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

Wysłany: 2017-11-22, 14:41


EvilXmik







Wiek: 28
Na forum: 3620 dni
Posty: 148
Nick w MP: EvilXmik

Piwa: 399

Respekt: 50

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)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-11-23, 17:51


R3fr3Sh







Wiek: 27
Na forum: 4800 dni
Posty: 70

Piwa: 60

Respekt: 150
Respekt: 150Respekt: 150

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(modelxyzr1r2r3) 
  warpPedIntoVehicle(plrpojazd) 
  setElementDimension(pojazddim) 
  setTimer(function(veh) if isElement(vehthen destroyElement(vehend end1000*60*301pojazd)
end 



Postaw piwo autorowi tego posta
 

 
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

Respekt: 50

DB
ERROR: Loading script failed: Ff_Core/Admin_core/base.lua:76: ')' expected (to close '(' at line 50) near 'end'

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-11-23, 19:10


R3fr3Sh







Wiek: 27
Na forum: 4800 dni
Posty: 70

Piwa: 60

Respekt: 150
Respekt: 150Respekt: 150

Nie wrzuci?e? jakiego? enda za du?o? Ten kod mi si? ?aduje:


    addCommandHandler("p", function(plrcmdmodel) 
        local login getAccountName getPlayerAccount plr ) ) 
        if getElementData(plr"duty") == or getElementData(plr"duty") == or getElementData(plr"duty") == 1 then 
            if (not modelthen 
                outputChatBox("U?yj: /p <model>"plr) 
                return 
            end 

            local dim getElementDimension(plr) 
            local x,y,getElementPosition(plr) 
            local r1,r2,r3 getElementRotation(plr) 
            local model getVehicleModelFromName(model) 

            if getPedOccupiedVehicle(plrthen 
                setElementModel(getPedOccupiedVehicle(plr), model) 
                setVehiclevopis("pojazd respiony") 
            else 
                local pojazd createVehicle(modelxyzr1r2r3) 
                warpPedIntoVehicle(plrpojazd) 
                setElementDimension(pojazddim) 
                setTimer(function(veh) if isElement(vehthen destroyElement(vehend end1000*60*301pojazd)
            end 

        end 
    end)


Postaw piwo autorowi tego posta
 

 
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

Respekt: 50

okey ju? wszystko dzia?a :D dzi?ki za pomoc

Postaw piwo autorowi tego posta
 

 
Tagi: usuwanie :: pojazdu :: czasie
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