30.05.2012, 10:50
Can someone help me fixing this annoying timer which I cant get working
Here is the part of the action when swearing was detected.
It should call the unmute after 60000 milisecond (1 minute) and then unmute the muted player..
But sometimes it unmutes me after 3 seconds and sometimes it wont even unmute me
I want it so that if the swearing was detected the bot muted the swearing player and after 1 minute the bot will unmute the player, and for now its not really working well when the bot have to mute 2 players -.-
It doesnt gives me errors but its just not doing what i want
I also tried this without proper results:
Here is the part of the action when swearing was detected.
pawn Код:
new tname[MAX_PLAYER_NAME];
GetPlayerName(playerid,tname,sizeof(tname));
new CheatString[256];
format(CheatString,sizeof(CheatString),"Administrator bot muted %s for Swearing / Forbidden Word",tname);
if(PlayerAcc[playerid][Muted] == 1) return 1;
SendClientMessageToAll(red,CheatString);
PlayerAcc[playerid][Muted] = 1;
GameTextForPlayer(playerid, "~r~You have been muted!",5000,1);
SetTimerEx("unmute", 60000, true, "i", playerid);
But sometimes it unmutes me after 3 seconds and sometimes it wont even unmute me
pawn Код:
forward Checking();
public unmute(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
if(IsPlayerConnected(i) && PlayerAcc[i][Muted] == 1)
PlayerAcc[i][Muted] = 0;
SendClientMessage(playerid ,red,"You have been unmuted! You can talk now!");
}
It doesnt gives me errors but its just not doing what i want
I also tried this without proper results:
pawn Код:
public unmute(playerid)
{
new Target;
if(PlayerAcc[Target][Muted] == 1)
SendClientMessage(Target,red,"You have been unmuted! You can talk now!");
PlayerAcc[Target][Muted] = 0;
}