Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local p2pRequested = nil
- RegisterCommand("p2p", function(source, args)
- local action = args[1]
- local player = args[2]
- target = tonumber(args[2])
- if(action == "request")then
- if(p2prequested ~= target)then
- p2pChat("Point 2 Point request sent!")
- TriggerServerEvent("p2p:requested", target)
- p2prequested = target
- requestNotify("Point 2 Point request sent to "..GetPlayerName(GetPlayerFromServerId(target)).."!",GetPlayerName(GetPlayerFromServerId(source)))
- RegisterClientEvent("sentRequest")
- else
- p2pChat("You have already requedted a Point 2 Point with this player!")
- end
- elseif(action == "accept")then
- p2pChat("Point 2 Point request accepted")
- TriggerServerEvent("p2p:accepted", target)
- p2prequested = nil
- elseif(action == "deny")then
- p2pChat("Point 2 Point request denied")
- TriggerServerEvent("p2p:denied", target)
- else
- p2pChat("Possible args: request, accept, deny")
- p2pChat("Example:/p2p request 1")
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement