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

Wysłany: 2021-02-21, 13:05


NoNamik







Wiek: 35
Na forum: 2185 dni
Posty: 289
Nick w MP: JestemNoNamem

Piwa: 374

Respekt: 60

Witam mam parking sara(policyjny) lecz gdy sie odda to nie nadaje sie "zaladowane",false i wyskakuje blad ze nie mozna ustawic


local oddanie createMarker(-1885.57, -141.3611.90-1,"cylinder",5,0,255,82)
local text createElement('text')
setElementPosition(text,-1885.57, -141.3611.90)
setElementData(text,"name","Punkt oddania pojazd?w")

createBlip(-1862.29, -145.7711.9058,2,0,0,0,0,0,275)




addEventHandler("onMarkerHit",oddanie,function(el,md)
if getElementType(el) ~= "player" then return end
local veh getPedOccupiedVehicle(el)
if not veh then return end
if veh and getElementModel(veh) ~= 578 then return end
local faction getElementData(el,"player:faction")
if not faction or (faction and faction ~= "SARA"then return end
local tow getElementData(veh"zaladowane")
if not tow then return end
triggerClientEvent(el,"glownyparking:refresh",root,tow)
end)
addEventHandler("onMarkerLeave",oddanie,function(el,md)
if getElementType(el) ~= "player" then return end
local veh getPedOccupiedVehicle(el)
if not veh then return end
if veh and getElementModel(veh) ~= 578 then return end
local faction getElementData(el,"player:faction")
if not faction or (faction and faction ~= "SARA"then return end
local tow getElementData(veh"zaladowane")
if not tow then return end
triggerClientEvent(el,"glownyparking:chowaj",root)
end)



local clicker = {}



addEvent("glownyparking:oddaj",true)
addEventHandler("glownyparking:oddaj",root,function(tabelka)
if not tabelka then return end
if clicker[tabelka[1]] then return end
if tonumber(tabelka[5]) < 1000000 then outputChatBox("** Minimalna suma to 1,000,000 $ !",client) return end
if tonumber(tabelka[5]) > 50000000 then outputChatBox("** Maksymalna suma to 50,000,000 $ !",client) return end
exports['pystories-db']:dbSet("INSERT INTO pystories_vehicles_parking (idpojazdu, funkcjonariusz,rejestracja,data,powod,cena) VALUES (?, ?,?,NOW(),?,?)",tabelka[2],tabelka[3],tabelka[4],tabelka[6],tabelka[5])
exports['pystories-db']:dbSet("Update pystories_vehicles set police=1 where id=?",tabelka[2])
outputChatBox("** Pomyslnie oddano pojazd na parking policyjny.",client,255,255,255)
clicker[tabelka[1]] = true
setElementData(veh"zaladowane",false)
setTimer(function(xdestroyElement(x); clicker[x] = nil end,350,1,tabelka[1])

end)


local odbior createMarker(-1862.29, -145.7711.90-1,"cylinder",1.2,0,255,0)
local text createElement('text')
setElementPosition(text,-1862.29, -145.7711.90)
setElementData(text,"name","Punkt odbioru pojazdow")

addEventHandler("onMarkerHit",odbior,function(el,md)
if getElementType(el) ~= "player" then return end
local veh getPedOccupiedVehicle(el)
if veh then return end
local uid getElementData(el,"player:sid")
local tabelka exports['pystories-db']:dbGet("SELECT pystories_vehicles_parking.*,pystories_users.id,pystories_vehicles.id,pystories_vehicles.driver,pystories_vehicles.ownedPlayer from pystories_users left join pystories_vehicles on pystories_vehicles.ownedPlayer=pystories_users.id left join pystories_vehicles_parking on pystories_vehicles_parking.idpojazdu = pystories_vehicles.id where pystories_users.id=? and pystories_vehicles.police=1",uid)
if not tabelka or tabelka and #tabelka < 1 then outputChatBox("** Brak pojazd?w do wybrania !",el) return end
triggerClientEvent(el,"odbior:refresh",root,tabelka)
end)

addEventHandler("onMarkerLeave",odbior,function(el,md)
if getElementType(el) ~= "player" then return end
local veh getPedOccupiedVehicle(el)
if veh then return end
triggerClientEvent(el,"odbior:chowaj",root,tabelka)
end)

addEvent("odbior:wydaj",true)
addEventHandler("odbior:wydaj",root,function(id,cena)
if not id then return end
local money getPlayerMoney(client)
if money cena then outputChatBox("** Brak pieni?dzy na wyci?gni?cie pojazdu !",clienttriggerClientEvent(client,"odbior:schowaj",root) return end
exports['pystories-db']:dbSet("DELETE from pystories_vehicles_parking where idpojazdu=?",id)
exports['pystories-db']:dbSet("Update pystories_vehicles set police=0,parking=1 where id=?",id)
local poss = {-1876.55, -141.6014.450.00.0359.7}
exports['pystories-vehicles']:onRespawnVehicles(_,id,poss)
outputChatBox("** Pomyslnie wybrano pojazd z parkingu policyjnego.",client,255,255,255)
takePlayerMoney(client,cena)
end)



Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-02-21, 15:31


Lagoon52







Wiek: 36
Na forum: 1930 dni
Posty: 11
Nick w MP: Lagoon



Respekt: 50

Poka? b??dy z debugscripta

Postaw piwo autorowi tego posta
 

 
Tagi: parking :: sara
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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