SA-MP Forums Archive
Muting help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Muting help (/showthread.php?tid=225976)



Muting help - thimo - 14.02.2011

Hey i made this code
pawn Код:
forward unmute2(playerid);
public unmute2(playerid)
{
    GetPlayerName(playerid, name2, sizeof(name2));
    Muted[playerid] = 1;
    format(string5, sizeof(string5), "ET Bot: %s has been muted for swearing for 1 minute", name2);
    SendClientMessageToAll(playerid, string5);
    SetTimer("unmute", 1000*60, false);
}
new string25[700];
forward unmute(playerid);
public unmute(playerid)
{
    Muted[playerid] = 0;
    format(string25, sizeof(string25), "ET Bot: %s has been unmuted", name2);
    SendClientMessageToAll(playerid, string25);
    IsPlayerMuted[playerid] = 0;

}
But it only mutes ID 0 and not the guy who sweared how to fix ? :S


Re: Muting help - Fj0rtizFredde - 14.02.2011

Use SetTimerEx insteed


Re: Muting help - thimo - 15.02.2011

Example ? i never used SetTimerEx.


Re: Muting help - iggy1 - 15.02.2011

pawn Код:
SetTimerEx("unmute", 1000*60, false, "i", playerid);//this just means you are calling a function on a timer that takes "playerid" as a parameter.
https://sampwiki.blast.hk/wiki/SetTimerEx