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

Wysłany: 2016-07-11, 17:22


JołMadaFakaJoł

Ucze się LUA :)






Wiek: 23
Na forum: 3625 dni
Posty: 11
Nick w MP: BoQu

Piwa: 42

Respekt: 60

Ostrzeżeń: 100%
local vehs={
{597,2},
}


local x,y,z=1590.92, -1710.275.51


for _,v in ipairs(vehs)do
    local auto=createVehicle(v[1],x,y,z)
    removeVehicleSirens(veh) --Usuwa stare syreny 
    addVehicleSirens veh61falsefalsefalsetrue )
    setVehicleSirens veh10.3002.4000.000023255255255 )
    setVehicleSirens veh2, -0.3002.5000.00025500255255 )
    setVehicleSirens veh3, -0.500, -0.4000.900255017255255 )
    setVehicleSirens veh40.500, -0.4001.000110255255255 )
    setVehicleSirens veh5, -0.700, -2.7000.00025500255255 )
    setVehicleSirens veh60.700, -2.8000.000255030255255 )
    setVehicleColor(auto,16,0,255,255,255,255)
    setElementData(auto,"frakcja","SAPD")
    setElementData(auto,"poziom",v[2])
    y=y+6
end

addEventHandler("onVehicleStartEnter",root,function(e,seat)
    if seat==0 then
        if getElementData(source,"frakcja"then
            if getElementData(source,"frakcja")=="SAPD" then
                if getElementData(e,"player:duty")~="SAPD" then
                    cancelEvent()
                end
                local q=dbQuery(db,"SELECT * FROM `Frakcje` WHERE `Nick`=?",getPlayerName(e))
                local x=dbPoll(q,-1)
                dbFree(q)
                if x[1].Poziom<getElementData(source,"poziom"then
                    cancelEvent()
                end
            end
        end
    end
end)

--------------------------------
Powie kto? w czym problem albo przerobi ten kod na poprawny ?

[ Komentarz dodany przez: AteX: 2016-07-11, 17:30 ]
Stosuj znaczniki LUA

Ostatnio zmieniony przez AteX 2016-07-11, 17:29, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-11, 17:30


AteX







Wiek: 26
Na forum: 4015 dni
Posty: 927
Nick w MP: #AteX

Piwa: 8360

Respekt: 775,3
Respekt: 775,3Respekt: 775,3

Jakie? b??dy w db3 (/debugscript 3)?

Podpis
MultiTheftAuto++ dla MTA 1.5.7 już dostępne.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-11, 17:34


JołMadaFakaJoł

Ucze się LUA :)






Wiek: 23
Na forum: 3625 dni
Posty: 11
Nick w MP: BoQu

Piwa: 42

Respekt: 60

Ostrzeżeń: 100%


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-11, 17:37


AteX







Wiek: 26
Na forum: 4015 dni
Posty: 927
Nick w MP: #AteX

Piwa: 8360

Respekt: 775,3
Respekt: 775,3Respekt: 775,3

M?g?by? da? wi?kszy obrazek? Tutaj nic nie wida?...

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-11, 17:40


JołMadaFakaJoł

Ucze się LUA :)






Wiek: 23
Na forum: 3625 dni
Posty: 11
Nick w MP: BoQu

Piwa: 42

Respekt: 60

Ostrzeżeń: 100%
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-11, 17:43


AteX







Wiek: 26
Na forum: 4015 dni
Posty: 927
Nick w MP: #AteX

Piwa: 8360

Respekt: 775,3
Respekt: 775,3Respekt: 775,3

Nie zauwa?y?em, ?e zmienne si? nie zgadzaj?.
for _,v in ipairs(vehs)do
    local auto=createVehicle(v[1],x,y,z)
    removeVehicleSirens(veh) --Usuwa stare syreny 
    addVehicleSirens veh61falsefalsefalsetrue )
    setVehicleSirens veh10.3002.4000.000023255255255 )
    setVehicleSirens veh2, -0.3002.5000.00025500255255 )
    setVehicleSirens veh3, -0.500, -0.4000.900255017255255 )
    setVehicleSirens veh40.500, -0.4001.000110255255255 )
    setVehicleSirens veh5, -0.700, -2.7000.00025500255255 )
    setVehicleSirens veh60.700, -2.8000.000255030255255 )
    setVehicleColor(auto,16,0,255,255,255,255)
    setElementData(auto,"frakcja","SAPD")
    setElementData(auto,"poziom",v[2])
    y=y+6
end

Pojazd jest pod zmienn? auto, a syreny przypisuje do veh, kt?ry nie istnieje. Zmie? wsz?dzie veh na auto.

Podpis
MultiTheftAuto++ dla MTA 1.5.7 już dostępne.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-11, 17:48


JołMadaFakaJoł

Ucze się LUA :)






Wiek: 23
Na forum: 3625 dni
Posty: 11
Nick w MP: BoQu

Piwa: 42

Respekt: 60

Ostrzeżeń: 100%
Dzi?kuje Dzia?a !! :D

Postaw piwo autorowi tego posta
 

 
Tagi: nie :: moge :: zrobić :: sygnałków :: świetlnych :: dla :: sapd
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