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

Wysłany: 2020-05-16, 19:05


Fabian111







Wiek: 26
Na forum: 2857 dni
Posty: 14
Nick w MP: FaBiaN

Piwa: 7

Respekt: 40

Dzie? dobry, chcia?bym zrobi? skrypt na /wariant czyli np wpisuje /wariant i przyk?adowo burrito zmienia wariant na ten ze "spoilerem" i ?wiat?ami a jak znowu to to znika (je?eli kto? ma link/skrypt to je?eli mo?e podes?a? to niech pode?le).

ZA UWAG? DZI?KUJE!

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-16, 20:07


Wilq







Wiek: 24
Na forum: 4569 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8


Więcej informacji znajdziesz w Wikipedii MTA:

setVehicleVariant


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-16, 23:09


MeeShuffle

Programista/Grafik






Wiek: 33
Na forum: 4536 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8578

Respekt: 535,3
Respekt: 535,3

Wystarczy troche poszuka? na wiki, zaj??o mi to minut?, przyk?ad z wiki :
function setMyVehiclesVariant(theUser, command, var1, var2)
    local var1, var2 = tonumber(var1), tonumber(var2) -- If anything was passed make sure its number or nil
    local myVeh = getPedOccupiedVehicle(theUser) -- Get the vehicle that they're in
    if (myVeh and getVehicleController(myVeh) == theUser) then -- Make sure they're in control
        local wasSet = setVehicleVariant(myVeh, var1, var2) -- Set what they wanted
        if (wasSet) then
            outputChatBox("Vehicle variant successfully set!", theUser, 0, 255, 0)
        else
            outputChatBox("Vehicle variant unsuccessfully set.", theUser, 255, 255, 0)
        end
    end
end
addCommandHandler("setvehvar", setMyVehiclesVariant) -- Add the command


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-05-17, 22:31


Matikmontana

Modern Stories






Wiek: 22
Na forum: 2614 dni
Posty: 424
Nick w MP: Mazeusz*

Piwa: 1023

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
Tutaj masz z pysa
function wariant(plr, cmd, var1, var2)
    local veh = getPedOccupiedVehicle(plr)
    if not veh then return end
    local var1, var2 = getVehicleVariant(veh)
    if (veh and getVehicleController(veh) ~= plr) then return end
    local speedx, speedy, speedz = getElementVelocity(veh)
    if not speedx then speedx=0 end
    if not speedy then speedy=0 end
    if not speedz then speedz=0 end
    speedx = tonumber(speedx);speedy=tonumber(speedy);speedz=tonumber(speedz)
    local speed = (speedx^2 + speedy^2 + speedz^2)^(0.5) * 180
    if speed > 2 then outputChatBox("St?j w miejscu!",plr,255,255,255) return end
    if getElementData(plr, "wariant:blokada", true) then outputChatBox("* Tej komendy mo?esz u?ywa? co 30 sekund!", plr, 255, 0, 0) return end
    setElementData(plr, "wariant:blokada", true)
    setTimer ( setElementData, 30000, 1, plr, "wariant:blokada", false )
    local panel = {}
    for i=0,6 do
    panel[i] = getVehiclePanelState ( veh, i )
    end
    setVehicleVariant(veh, tonumber(not var1), tonumber(not var1))
    for i=0, 6 do
    setVehiclePanelState ( veh, i ,panel[i])
    end
end
addCommandHandler("wariant", wariant)


Postaw piwo autorowi tego posta
 

 
Tagi: warianty :: pojazdu.
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Warianty pojazdu. Odpowiedz do tematu

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