wadsonlucas

Untitled

Oct 25th, 2019
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. ========================CFG/HOSTKEYS.LUA==========================
  2. [289] = {
  3. -- F2 - Police Send QTH
  4. group = 1,
  5. pressed = function()
  6. if not IsPauseMenuActive() and (GetEntityHealth(GetPlayerPed(-1)) > 105) and not vRP.isHandcuffed({}) then -- Comment to allow use in vehicle
  7. local x,y,z = table.unpack(GetEntityCoords(GetPlayerPed(-1),true))
  8. HKserver.sendQTHPolice({x,y,z})
  9. Citizen.Wait(1000)
  10. end -- Comment to allow use in vehicle
  11. end,
  12. released = function()
  13. -- Do nothing on release because it's toggle.
  14. end,
  15. },
  16. =====================SERVER.LUA======================================
  17. function vRPhk.sendQTHPolice(x,y,z)
  18. local user_id = vRP.getUserId({source})
  19. if user_id and vRP.hasPermission({user_id,"police.base"}) then
  20.  
  21. vRP.getUserIdentity({user_id, function(identity)
  22. vRP.sendServiceAlert({source,"Policia",x,y,z,"QTH " .. identity.user_id .. " " .. identity.user_id}) -- people will change this message anyway haha
  23. end})
  24. end
  25. end
Advertisement
Add Comment
Please, Sign In to add comment