Ola Boa Tarde eu gostaria de saber como faço para mudar a msg assim que um jogador for banido, queria q mostrasse para todos os jogadores verem no chat
O ID (id) foi banido pelo staff (nick do staff)
Motivo: (motivo do ban)
Tempo : (tempobanido)
function showPanel (source)
if isPlayerInACL (source, "Console") then
triggerClientEvent (source, "onClientOpenPanel", resourceRoot)
end
end
addCommandHandler ("banir", showPanel)
function onPanelManager (type, ID, reasonBan, timeBan)
local theAccount = getAccountByID (ID)
se não theAccount, então
retorna outputChatBox ("Este ID é inexistente", client, 255, 0, 0)
end
if type == "buscar" then
local thePlayer = getAccountPlayer (theAccount)
se thePlayer then
triggerClientEvent (client, "onClientSetInfo", resourceRoot, "info", "Online", removeHex (getPlayerName (thePlayer)), getAccountName (getPlayerAccount (thePlayer)), getAccountSerial (thePlayer), getAccountData theAccount, "ban") ou 0)
else
triggerClientEvent (client, "onClientSetInfo", resourceRoot, "info", "Offline", "N / A", getAccountName (theAccount), getAccountSerial (theAccount) == "" e "N / A" ou getAccountSerial (theAccount), getAccountData (theAccount, "ban") ou 0)
end
elseif type == "banir" then
local thePlayer = getAccountPlayer (theAccount)
se thePlayer, em seguida,
serial local = getPlayerSerial (thePlayer)
se addBan (nil, nil, serial, cliente, reasonBan, timeBan ) then
outputChatBox ("O ID:" ..ID .. "foi banido com sucesso", client, 0, 255, 0)
triggerClientEvent (client, "onClientSetInfo", resourceRoot,"clearEdit")
end
else
local serial = getAccountSerial (theAccount)
if addBan (nil, nil, serial, client, reasonBan, timeBan) then
outputChatBox ("O ID:" ..ID .. "foi banido com sucesso", client, 0, 255, 0)
triggerClientEvent (client, "onClientSetInfo", resourceRoot, "clearEdit")
local dataBan = getAccountData (theAccount, "ban") ou 0
setAccountData (theAccount, "ban", dataBan + 1)
end
end
end
end
addEvent ("onPanelManager", verdadeiro )
addEventHandler ("onPanelManager", resourceRoot, onPanelManager)
function fPlayerBan()
local account = getPlayerAccount(source)
if not isGuestAccount(account) then
local dataBan = getAccountData(account, "ban") or 0
setAccountData(account, "ban", dataBan + 1)
end
end
addEventHandler("onPlayerBan", root, fPlayerBan)
function isPlayerInACL(player, acl)
local accountName = getAccountName( getPlayerAccount(player) )
if accountName ~= "guest" and type( aclGetGroup(acl) ) == "userdata" then
return isObjectInACLGroup( "user."..accountName, aclGetGroup(acl) )
end
return false
end
function removeHex (s)
if type (s) == "string" then
while (s: find ("#% x% x% x% x% x% x")) do
s = s: gsub ("#% x % x% x% x% x% x "," ")
end
end
return s ou false
end