Problem 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: Problem with /mute (
/showthread.php?tid=227467)
Problem with /mute -
spedico - 17.02.2011
pawn Код:
public OnPlayerText(playerid, text[])
{
if(GetPVarInt(playerid, "Muted") == 1) return 0;
return 1;
}
/mute cmd:
pawn Код:
COMMAND:mute(playerid, params[])
{
new user;
if(!sscanf(params, "u", user))
{
SendClientMessage(user, RED, "You have been muted by an admin.");
SetPVarInt(playerid, "Muted", 1);
}
else return SendClientMessage(playerid, RED, "USAGE: /mute id");
return 1;
}
Problem is, when I mute someone, everyone gets muted.
Re: Problem with /mute -
Pangea - 17.02.2011
pawn Код:
COMMAND:mute(playerid, params[])
{
new user;
if(!sscanf(params, "u", user))
{
SendClientMessage(user, RED, "You have been muted by an admin.");
SetPVarInt(user, "Muted", 1);
}
else return SendClientMessage(playerid, RED, "USAGE: /mute id");
return 1;
}
Not everybody was getting muted.
Only the admin who performed the command.
You muted the admin instead of the ID that is given.
You placed "playerid" instead of "user" in SetPVarInt.
Try this out. Should be working.
If it doesn't report back here (if you need help)
Re: Problem with /mute -
spedico - 17.02.2011
Oh, I see. Works now, kinda stupid mistake. Thanks.
Re: Problem with /mute -
jejemonerz123 - 18.02.2011
just ban em XD