SA-MP Forums Archive
[Ask] How to turn off chat for all - 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: [Ask] How to turn off chat for all (/showthread.php?tid=396807)



[Ask] How to turn off chat for all - edwardluciano - 02.12.2012

Hello, Everyone i has problem

Ex:
When i chat original all player can see that text every where

and when i use that code

Код:
new realchat = 1;

public OnPlayerText(playerid, text[])
{
    new sendername[MAX_PLAYER_NAME];
    new string[256];
    if (realchat)
	{
	    if(gPlayerLogged[playerid] == 0)
	    {
	        return 0;
      	}
      	new idx;
        new length = strlen(text);
		while ((idx < length) && (text[idx] <= ' '))
		{
			idx++;
		}
		new offset = idx;
		new result[256];
		while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
		{
			result[idx - offset] = text[idx];
			idx++;
		}
		result[idx - offset] = EOS;
      	        new bbs[MAX_STRING];
                format(bbs, sizeof(bbs), "'' %s ''", text);
		SetPlayerChatBubble(playerid,bbs, 0xFF436FFF, 20.0, 10000);
		GetPlayerName(playerid, sendername, sizeof(sendername));
  		format(string, sizeof(string), "%s: %s", sendername, text);
		ProxDetector(20.0, playerid, string, COLOR_GRAD5, COLOR_GRAD5, COLOR_GRAD5, COLOR_GRAD5, COLOR_GRAD5);
		if(!IsPlayerInAnyVehicle(playerid))	ApplyAnimation(playerid,"PED","IDLE_CHAT",4.0,0,0,0,1,1);
		return 1;
  	}
	return 1;
}
See this



line 1 Original text
line 2 realchat ProxDetector 20.0

I need turnoff line 1 how to make it


sorry my English skill not good.
and sorry if this topic wrong section. Thankyou


Re: [Ask] How to turn off chat for all - JaKe Elite - 02.12.2012

make the return 1; of OnPlayerText to return 0;


Re: [Ask] How to turn off chat for all - edwardluciano - 02.12.2012

Quote:
Originally Posted by Romel
Посмотреть сообщение
make the return 1; of OnPlayerText to return 0;
not work TT TT


Re: [Ask] How to turn off chat for all - tsonn1 - 02.12.2012

Change the last return 1; to return 0;


Re: [Ask] How to turn off chat for all - edwardluciano - 02.12.2012

OK it work already thankyou