Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.32 KB | None | 0 0
  1. function vRP.setSequestro(user_id,vehicle,sequestro)
  2. MySQL.execute("vRP/set_sequestro", {user_id = user_id, vehicle = vehicle, sequestro = sequestro})
  3. end
  4.  
  5. -- main menu choices
  6. local choice_sequestro = {function(player,choice)
  7. local user_id = vRP.getUserId(player)
  8. if user_id ~= nil then
  9. vRPclient.getNearestVehicle2(player,{5},function(veh,name,targa)
  10. if veh then
  11. if string.sub(targa, 1, 1) == "P" then
  12. -- vRPclient.controllaPosizione(player,{532.146,-168.722,54.831,5},function(inpos)
  13. -- if inpos then
  14. vRP.request(player,"Sequestrare: "..name.." - Reg: "..targa,30,function(player,ok)
  15. if ok then
  16. local newtarga = string.gsub(targa, "P ", "")
  17. vRP.getUserByRegistration(newtarga, function(nuser_id)
  18. if nuser_id then
  19. vRP.setSequestro(tonumber(nuser_id),string.lower(name),true)
  20. vRPclient.notify(player,{"~g~Veicolo sequestrato"})
  21. local nplayer = vRP.getUserSource(tonumber(nuser_id))
  22. if nplayer then
  23. vRPclient.notify(nplayer,{"~b~Il tuo veicolo ~g~"..name.."~b~ è stato sequestrato"})
  24. end
  25. else
  26. vRPclient.notify(player,{"~r~"..newtarga.." stranamente non registrata...(Reporta questo errore)"})
  27. end
  28. end)
  29. else
  30. vRPclient.notify(player,{"~r~Devi trovarti nella zona di sequestro.."})
  31. end
  32. end)
  33. else
  34. vRPclient.notify(player,{"~r~Macchina non registrata"})
  35. end
  36. else
  37. vRPclient.notify(player,{"~r~Nessuna macchina vicina"})
  38. end
  39. end)
  40. end
  41. end,"Sequestra veicolo vicino a te."}
  42.  
  43. local choice_disequestro = {function(player,choice)
  44. local user_id = vRP.getUserId(player)
  45. if user_id ~= nil then
  46. vRPclient.getNearestPlayer(player,{10},function(nplayer)
  47. if nplayer ~= nil then
  48. local nuser_id = vRP.getUserId(nplayer)
  49. if nuser_id ~= nil then
  50. vRP.prompt(player,"Macchina da restituire","",function(player, name)
  51. vRP.setSequestro(nuser_id,name,false)
  52. vRPclient.notify(player,{"~g~Veicolo restituito"})
  53. vRPclient.notify(nplayer,{"~b~Il tuo veicolo ~g~"..name.."~b~ ti è stato restituito"})
  54. end)
  55. end
  56. else
  57. vRPclient.notify(player,{"~r~Nessun player vicino"})
  58. end
  59. end)
  60. end
  61. end,"Restituisci il veicolo"}
  62.  
  63. local choice_disequestro_2 = {function(player,choice)
  64. local user_id = vRP.getUserId(player)
  65. if user_id ~= nil then
  66. vRP.prompt(player,"Inserisci [user_id]","",function(player,nuser_id)
  67. local nuser_id = nuser_id
  68. local nplayer = vRP.getUserSource(nuser_id)
  69. if nuser_id ~= nil and nuser_id ~= "" then
  70. vRP.prompt(player,"Macchina da restituire","",function(player, name)
  71. vRP.setSequestro(nuser_id,name,false)
  72. vRPclient.notify(player,{"Veicolo restituito"})
  73. if nplayer then
  74. vRPclient.notify(nplayer,{"Il tuo veicolo "..name.." ti è stato restituito"})
  75. end
  76. end)
  77. end
  78. end)
  79. end
  80. end,"Restituisci il veicolo"}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement