SA-MP Forums Archive
need help with /mute - 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: need help with /mute (/showthread.php?tid=74088)



need help with /mute - WardenCS - 19.04.2009

i got mute command,it mutes urself,can someone help me?


Quote:

}
if(strcmp(cmd, "/mute", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[USAGE:] /mute [playerid]");
return 1;
}
new playa;
playa = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
if(Muted[playerid] == 0)
{
Muted[playerid] = 1;
format(string, sizeof(string), "[INFO:] You muted %s.",GetPlayerNameEx(playa));
SendClientMessage(playerid,COLOR_ADMINCMD,string);
format(string, sizeof(string), "[INFO:] You have been muted by %s.",GetPlayerNameEx(playerid));
SendClientMessage(playa,COLOR_ADMINCMD,string);
}
else
{
Muted[playerid] = 0;
format(string, sizeof(string), "[INFO:] You unmuted %s.",GetPlayerNameEx(playa));
SendClientMessage(playerid,COLOR_ADMINCMD,string);
format(string, sizeof(string), "[INFO:] You have been unmuted by %s.",GetPlayerNameEx(playerid));
SendClientMessage(playa,COLOR_ADMINCMD,string);
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] Your not an administrator/correct level");
}
}
return 1;
}




Re: need help with /mute - Rks25 - 19.04.2009

replace this:
Muted[playerid] = 1;
Muted[playerid] = 0;
Muted[playerid] == 0

with Muted[playa] = 1;
..
..

etc.



Re: need help with /mute - WardenCS - 19.04.2009

thanks dude it worked


Re: need help with /mute - Rks25 - 19.04.2009

no problem man.