OnPlayerCommandPerformed
#1

I added check if the player is muted but it sends the message and still shows the command action.

Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
	if(PlayerInfo[playerid][pMuted] == 1)
	{
		SCM(playerid, COLOR_RED, "You cannot speak, you have been silenced");
		return 0;
	}
    if(!success)
    {
        new string[256];
        format(string, sizeof(string), "Error: {FFFFFF}The command '%s' was not recognised, please type /help.", cmdtext);
        SCM(playerid,COLOR_RED, string);
    }
    return 1;
}
Reply
#2

Change
pawn Код:
SCM(playerid,COLOR_RED, string);
with
pawn Код:
return SCM(playerid,COLOR_RED, string), 0;
Reply
#3

still now worst
Reply
#4

k i changed the 0 to 1
Reply
#5

Ok, go to your OnPlayerCommandTextpublic and return 0; there.
And edit the script I post before to your old script.
Reply
#6

Use OnPlayerCommandReceived instead!
Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
	if(PlayerInfo[playerid][pMuted] == 1)
	{
		SCM(playerid, COLOR_RED, "You cannot speak, you have been silenced");
		return 0;
	}
	return 1;
}
Reply
#7

Lol yea i readed the post wrong, sorry.
use Mr_DjolE solution.
Reply
#8

thank you bro!
Reply
#9

Quote:
Originally Posted by PaulDinam
Посмотреть сообщение
thank you bro!
No problem.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)