Bump, this is the final thing :
Server :
local mute_time = {}
addEvent("onAdminMute", true)
addEventHandler("onAdminMute", root,
function (player, time)
iprint("OK")
if (not isElement(player)) then return end
if (mute_time[player] or not time) then
mute_time[player] = nil
setPlayerMuted(player, false)
outputChatBox(getPlayerName(player).. " has been unmuted by "..getPlayerName(client))
return
end
setPlayerMuted(player, true)
mute_time[player] = getRealTime().timestamp + time
end
)
setTimer(
function ()
for player, time in pairs(mute_time) do
if (not isElement(player)) then
mute_time[player] = nil
else
if (getRealTime().timestamp >= time) then
outputChatBox(getPlayerName(player).. " has been unmuted by Console")
setPlayerMuted(player, false)
mute_time[player] = nil
end
end
end
end,
1000, 0)
Client :
addEventHandler("onClientGUIClick", root,
function()
if (source == mywind[18]) then
local time = guiGridListGetSelectedItem(mywind[2])
local player = guiGridListGetItemText(mywind[16], guiGridListGetSelectedItem(mywind[16], 1))
if (time and player) then
player = getPlayerFromName(player)
if (not isElement(player)) then return end
time = (time == 0 and 60*1000 or time == 1 and 120*1000 or time == 2 and 180*1000 or time == 3 and 240*1000 or time == 4 and 300*1000 or time == 5 )
triggerServerEvent("onAdminMute", root, player, time)
return end
elseif (source == mywind[17]) then
local player = guiGridListGetItemText(mywind[16], guiGridListGetSelectedItem(mywind[16], 1))
if (player) then
player = getPlayerFromName(player)
if (not isElement(player)) then return end
triggerServerEvent("onAdminMute", root, player)
end
end
end
)
The script isnt showing any error, but the mute thing isnt getting triggered, any help please ? i keep pressing on "Mute" button but Nothing happpens nor i'm getting any errors