Bom, não está reconhecendo o id do jogador quando digita num chat, está dando N/A.
Print: https://prnt.sc/u6ikjl
Código do chat:
ComandoDoChatGlobal = "cp" ----COMANDO PARA UTILIZAR NO CHAT Ex:( /cp OI )
function adminchat ( thePlayer, _, ... )
local message = table.concat ( { ... }, " " )
local ID = getElementData(source, "ID") or "N/A"
if ( isPlayerOnGroup ( thePlayer ) ) then
for _, player in ipairs ( getElementsByType ( "player" ) ) do
if ( isPlayerOnGroup ( player ) ) then
conta = getAccountName(getPlayerAccount(thePlayer))
if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Policial" ) ) then ----ACL DE QUEM VAI VER/USAR O CHAT
outputChatBox("#ffFFFF| #FFA500COPOM #ffFFFF|#FFA500 "..getPlayerName(thePlayer).. " #ffffff["..ID..") » :#FFA500 "..message, player, 255, 255, 255, true)
elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Policial" ) ) then ----ACL DE QUEM VAI VER/USAR O CHAT
outputChatBox("#ffFFFF| #FFA500COPOM #ffFFFF|#FFA500 "..getPlayerName(thePlayer).. " #ffffff["..ID..") » :#FFA500 "..message, player, 255, 255, 255, true)
end
end
end
end
setElementData ( thePlayer, "Chat:Avisado", true )
setElementData ( thePlayer, "Chat:Delay1",true )
setTimer ( setElementData, 5000, 1, thePlayer, "Chat:Delay1", false )
end
addCommandHandler ( ComandoDoChatGlobal, adminchat )
--------------------------------------------------------------------------------------------
function isPlayerOnGroup ( thePlayer )
local account = getPlayerAccount ( thePlayer )
local inGroup = false
for _, group in ipairs ( { "Policial" } ) do ----ACL DE QUEM VAI VER/USAR O CHAT
if isObjectInACLGroup ( "user.".. getAccountName ( account ), aclGetGroup ( group ) ) then
inGroup = true
break
end
end
return inGroup
end