Advertisement
Guest User

Client.lua

a guest
Oct 14th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. local p2pRequested = nil
  2.  
  3.  
  4. RegisterCommand("p2p", function(source, args)
  5. local action = args[1]
  6. local player = args[2]
  7. target = tonumber(args[2])
  8. if(action == "request")then
  9. if(p2prequested ~= target)then
  10. p2pChat("Point 2 Point request sent!")
  11. TriggerServerEvent("p2p:requested", target)
  12. p2prequested = target
  13. requestNotify("Point 2 Point request sent to "..GetPlayerName(GetPlayerFromServerId(target)).."!",GetPlayerName(GetPlayerFromServerId(source)))
  14. RegisterClientEvent("sentRequest")
  15. else
  16. p2pChat("You have already requedted a Point 2 Point with this player!")
  17. end
  18. elseif(action == "accept")then
  19. p2pChat("Point 2 Point request accepted")
  20. TriggerServerEvent("p2p:accepted", target)
  21. p2prequested = nil
  22. elseif(action == "deny")then
  23. p2pChat("Point 2 Point request denied")
  24. TriggerServerEvent("p2p:denied", target)
  25.  
  26. else
  27. p2pChat("Possible args: request, accept, deny")
  28. p2pChat("Example:/p2p request 1")
  29. end
  30. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement