Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function vRP.setSequestro(user_id,vehicle,sequestro)
- MySQL.execute("vRP/set_sequestro", {user_id = user_id, vehicle = vehicle, sequestro = sequestro})
- end
- -- main menu choices
- local choice_sequestro = {function(player,choice)
- local user_id = vRP.getUserId(player)
- if user_id ~= nil then
- vRPclient.getNearestVehicle2(player,{5},function(veh,name,targa)
- if veh then
- if string.sub(targa, 1, 1) == "P" then
- -- vRPclient.controllaPosizione(player,{532.146,-168.722,54.831,5},function(inpos)
- -- if inpos then
- vRP.request(player,"Sequestrare: "..name.." - Reg: "..targa,30,function(player,ok)
- if ok then
- local newtarga = string.gsub(targa, "P ", "")
- vRP.getUserByRegistration(newtarga, function(nuser_id)
- if nuser_id then
- vRP.setSequestro(tonumber(nuser_id),string.lower(name),true)
- vRPclient.notify(player,{"~g~Veicolo sequestrato"})
- local nplayer = vRP.getUserSource(tonumber(nuser_id))
- if nplayer then
- vRPclient.notify(nplayer,{"~b~Il tuo veicolo ~g~"..name.."~b~ è stato sequestrato"})
- end
- else
- vRPclient.notify(player,{"~r~"..newtarga.." stranamente non registrata...(Reporta questo errore)"})
- end
- end)
- else
- vRPclient.notify(player,{"~r~Devi trovarti nella zona di sequestro.."})
- end
- end)
- else
- vRPclient.notify(player,{"~r~Macchina non registrata"})
- end
- else
- vRPclient.notify(player,{"~r~Nessuna macchina vicina"})
- end
- end)
- end
- end,"Sequestra veicolo vicino a te."}
- local choice_disequestro = {function(player,choice)
- local user_id = vRP.getUserId(player)
- if user_id ~= nil then
- vRPclient.getNearestPlayer(player,{10},function(nplayer)
- if nplayer ~= nil then
- local nuser_id = vRP.getUserId(nplayer)
- if nuser_id ~= nil then
- vRP.prompt(player,"Macchina da restituire","",function(player, name)
- vRP.setSequestro(nuser_id,name,false)
- vRPclient.notify(player,{"~g~Veicolo restituito"})
- vRPclient.notify(nplayer,{"~b~Il tuo veicolo ~g~"..name.."~b~ ti è stato restituito"})
- end)
- end
- else
- vRPclient.notify(player,{"~r~Nessun player vicino"})
- end
- end)
- end
- end,"Restituisci il veicolo"}
- local choice_disequestro_2 = {function(player,choice)
- local user_id = vRP.getUserId(player)
- if user_id ~= nil then
- vRP.prompt(player,"Inserisci [user_id]","",function(player,nuser_id)
- local nuser_id = nuser_id
- local nplayer = vRP.getUserSource(nuser_id)
- if nuser_id ~= nil and nuser_id ~= "" then
- vRP.prompt(player,"Macchina da restituire","",function(player, name)
- vRP.setSequestro(nuser_id,name,false)
- vRPclient.notify(player,{"Veicolo restituito"})
- if nplayer then
- vRPclient.notify(nplayer,{"Il tuo veicolo "..name.." ti è stato restituito"})
- end
- end)
- end
- end)
- end
- end,"Restituisci il veicolo"}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement