Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function revistar(source,cmd,st)
- local accountname = getAccountName(getPlayerAccount(source))
- if isObjectInACLGroup("user."..accountname, aclGetGroup("ComandosPolicia")) then -- Grupo permitido a usar o comando
- for i, p in ipairs(getElementsByType('player')) do
- local id = getElementData(p,"ID")
- if id == st then
- local cx,cy,cz = getElementPosition(p)
- local x,y,z = getElementPosition(source)
- local dist = getDistanceBetweenPoints3D(x,y,z,cx,cy,cz)
- if dist <= 5 then
- setPedAnimation( source, "POLICE", "plc_drgbst_01", 3100, true, false, false, false)
- triggerClientEvent(source, "REV:TimeEspera", source) -- Chamar evento do client
- exports.Scripts_Dxmessages:outputDx(p, "Você está sendo revistado pelo Jogador "..getPlayerName(source).."", "warning")
- setTimer(function(source)--\\ recebe o source como argumento para a funcao, para evitar falha na sincronizacao
- if isElement(source) then --\\ checa se é um elemento, para evitar warnings no debug caso o player tenha deslogado antes do timer ser completo
- triggerClientEvent(source, "DNL:Open_Revistar", source, p)
- triggerClientEvent(source, "REV:TimeEspera_Close", source) -- Chamar evento do client
- end
- end,3390,1,source) --\\ envia o source como argumento pra funcao do timer
- else
- exports.Scripts_Dxmessages:outputDx(source, "Chegue Mais perto para revistar o jogador!", "warning")
- end
- return
- end
- outputChatBox ( "#ff0000✘ #ffffffERRO #ff0000✘➺ #ffffff O Jogador(a) Não Foi Encontrado!", source, 255,255,255,true)
- end
- else
- outputChatBox ( "#ff0000✘ #ffffffERRO #ff0000✘➺ #FFFFFFVocê não tem permissão para utilizar este comando!", source, 255,255,255,true)
- end
- end
- addCommandHandler("revistar", revistar)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement