Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. function revistar(source,cmd,st)
  2. local accountname = getAccountName(getPlayerAccount(source))
  3. if isObjectInACLGroup("user."..accountname, aclGetGroup("ComandosPolicia")) then -- Grupo permitido a usar o comando
  4. for i, p in ipairs(getElementsByType('player')) do
  5. local id = getElementData(p,"ID")
  6. if id == st then
  7. local cx,cy,cz = getElementPosition(p)
  8. local x,y,z = getElementPosition(source)
  9. local dist = getDistanceBetweenPoints3D(x,y,z,cx,cy,cz)
  10. if dist <= 5 then
  11. setPedAnimation( source, "POLICE", "plc_drgbst_01", 3100, true, false, false, false)
  12. triggerClientEvent(source, "REV:TimeEspera", source) -- Chamar evento do client
  13. exports.Scripts_Dxmessages:outputDx(p, "Você está sendo revistado pelo Jogador "..getPlayerName(source).."", "warning")
  14. setTimer(function(source)--\\ recebe o source como argumento para a funcao, para evitar falha na sincronizacao
  15. if isElement(source) then --\\ checa se é um elemento, para evitar warnings no debug caso o player tenha deslogado antes do timer ser completo
  16. triggerClientEvent(source, "DNL:Open_Revistar", source, p)
  17. triggerClientEvent(source, "REV:TimeEspera_Close", source) -- Chamar evento do client
  18. end
  19. end,3390,1,source) --\\ envia o source como argumento pra funcao do timer
  20. else
  21. exports.Scripts_Dxmessages:outputDx(source, "Chegue Mais perto para revistar o jogador!", "warning")
  22. end
  23. return
  24. end
  25. outputChatBox ( "#ff0000✘ #ffffffERRO #ff0000✘➺ #ffffff O Jogador(a) Não Foi Encontrado!", source, 255,255,255,true)
  26. end
  27. else
  28. outputChatBox ( "#ff0000✘ #ffffffERRO #ff0000✘➺ #FFFFFFVocê não tem permissão para utilizar este comando!", source, 255,255,255,true)
  29. end
  30. end
  31. addCommandHandler("revistar", revistar)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement