Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1.  
  2.  
  3. RegisterServerEvent("onyx_garbagejob:tryStartJob")
  4. AddEventHandler("onyx_garbagejob:tryStartJob", function(location, tier)
  5. -- You can do checkperms or something here
  6.  
  7. TriggerClientEvent("onyx_garbagejob:startJob", source, location, tier)
  8. -- END
  9. end)
  10.  
  11.  
  12. RegisterServerEvent("givemoneyfortrash")
  13. AddEventHandler("givemoneyfortrash", function(trash)
  14. local user_id = vRP.getUserId({source})
  15. vRP.giveMoney({user_id, trash * 5})
  16. -- Do something when dropping of trash, like give money or exp
  17. end)
  18.  
  19.  
  20. RegisterServerEvent("onyx_garbagejob:pickupJob")
  21. AddEventHandler("onyx_garbagejob:pickupJob", function()
  22.  
  23. end)
  24.  
  25. AddEventHandler("chatMessage",function(source,name,msg)
  26. if msg:sub(1,4) == "/loc" then
  27. TriggerClientEvent("gd:pos",source,msg)
  28. CancelEvent()
  29. end
  30. end)
  31.  
  32. AddEventHandler("chatMessage",function(source,name,msg)
  33. if msg:sub(1,4) == "/stp" then
  34. TriggerClientEvent("onyx_garbagejob:stopjob",source)
  35. CancelEvent()
  36. end
  37. end)
  38.  
  39.  
  40. function stringsplit(inputstr, sep)
  41. if sep == nil then
  42. sep = "%s"
  43. end
  44. local t={} ; i=1
  45. for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
  46. t[i] = str
  47. i = i + 1
  48. end
  49. return t
  50. end
  51.  
  52.  
  53. RegisterServerEvent("gd:pos")
  54. AddEventHandler("gd:pos", function(text, pos)
  55. local name = text:sub(6)
  56. local str = string.format('{name = "%s", x = %f, y = %f, z = %f},', name, pos.x, pos.y, pos.z)
  57. print(str)
  58. local file = io.open("markers.dev", "a+")
  59. file:write(str .. "\n")
  60. file:close()
  61. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement