Mute player OnPlayerText
#6

Yeah, replace

Код:
public OnPlayerText(playerid, text[])
{
    if (realchat)
	{
	    new string[128];
		format(string, sizeof(string), "%s says: %s", GetName(playerid), text);
  		ProxDetector(30.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
		format(string, sizeof(string), "says: %s", text);
		SetPlayerChatBubble(playerid,string,COLOR_WHITE,5.0,5000);
		return 0;
	}
	
	if(PlayerInfo[playerid][pMuted] == 1)
	{
	        SendClientMessage(playerid, COLOR_GREY, "You can't speak, you're muted.");
	        printf("%d", PlayerInfo[playerid][pMuted]);
	        return 0;
	}
	return 1;
}
with

Код:
public OnPlayerText(playerid, text[])
{
	if(PlayerInfo[playerid][pMuted] == 1)
	{
	        SendClientMessage(playerid, COLOR_GREY, "You can't speak, you're muted.");
	        printf("%d", PlayerInfo[playerid][pMuted]);
	        return 0;
	}

    if (realchat)
	{
	    new string[128];
		format(string, sizeof(string), "%s says: %s", GetName(playerid), text);
  		ProxDetector(30.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
		format(string, sizeof(string), "says: %s", text);
		SetPlayerChatBubble(playerid,string,COLOR_WHITE,5.0,5000);
		return 0;
	}
	return 1;
}
You're sending the chat first, then checking if he's muted. You want to check he's muted before calling the (realchat) code in.
Reply


Messages In This Thread
Mute player OnPlayerText - by Ilaibens - 08.08.2017, 19:48
Re: Mute player OnPlayerText - by Swarn - 08.08.2017, 20:39
Re: Mute player OnPlayerText - by Ilaibens - 08.08.2017, 20:51
Re: Mute player OnPlayerText - by Misiur - 08.08.2017, 20:59
Re: Mute player OnPlayerText - by Ilaibens - 08.08.2017, 21:13
Re: Mute player OnPlayerText - by Swarn - 08.08.2017, 21:18
Re: Mute player OnPlayerText - by Ilaibens - 08.08.2017, 21:22
Re: Mute player OnPlayerText - by Swarn - 08.08.2017, 21:27

Forum Jump:


Users browsing this thread: 2 Guest(s)