If player is muted don't work - 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)
+--- Thread: If player is muted don't work (
/showthread.php?tid=315853)
If player is muted don't work -
geerdinho8 - 04.02.2012
pawn Код:
public OnPlayerText(playerid, text[])
{
new textv2[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof (name));
format(textv2, sizeof (textv2), "(id: %d) %s", playerid, text);
SendPlayerMessageToAll(playerid, textv2);
if(pInfo[playerid][Muted] == 1)
{
SendClientMessage(playerid, COLOR_RED, "You are muted, you can not talk!");
}
return 0;
}
If you are muted you can still talk, maybe someone can help me?
Re: If player is muted don't work -
Konstantinos - 04.02.2012
pawn Код:
public OnPlayerText(playerid, text[])
{
if(pInfo[playerid][Muted] == 1) {
SendClientMessage(playerid, COLOR_RED, "You are muted, you can not talk!");
return 0;
}
new textv2[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof (name));
format(textv2, sizeof (textv2), "(id: %d) %s", playerid, text);
SendPlayerMessageToAll(playerid, textv2);
return 0;
}
You must return 0 to prevent it.