SA-MP Forums Archive
Disabling global chat problem - 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: Disabling global chat problem (/showthread.php?tid=643654)



Disabling global chat problem - Escobabe - 24.10.2017

Hello, i'm trying to disable the players main/global chat. I have made this so far:

PHP код:
public OnPlayerText(playeridtext[])
{
    new 
string[150];
    
format(stringsizeof(string), "%s says: %s"PlayerName(playerid), text);
    
ProxDetector(30.0playeridstring,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
    
SetPlayerChatBubble(playerid,string,COLOR_WHITE,5.0,5000);
    return 
1;

But, this happens:




Re: Disabling global chat problem - RoboN1X - 24.10.2017

Код:
public OnPlayerText(playerid, text[])
{
    new string[144];
    format(string, sizeof(string), "%s says: %s", PlayerName(playerid), text);
    ProxDetector(30.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
    SetPlayerChatBubble(playerid,string,COLOR_WHITE,5.0,5000);
    return 0;
}
https://sampwiki.blast.hk/wiki/OnPlayerText
Quote:

Returning 0 in this callback will stop the text from being sent to all players.

Text longer than 144 characters will not show in ClientMessage & ChatBubble
Also you might want a different format for your chatbbuble string instead, to not show the player name as the chat bubble appears above the player name, unless you hide the name tags..


Re: Disabling global chat problem - Escobabe - 24.10.2017

Quote:
Originally Posted by RoboN1X
Посмотреть сообщение
Код:
public OnPlayerText(playerid, text[])
{
    new string[144];
    format(string, sizeof(string), "%s says: %s", PlayerName(playerid), text);
    ProxDetector(30.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
    SetPlayerChatBubble(playerid,string,COLOR_WHITE,5.0,5000);
    return 0;
}
https://sampwiki.blast.hk/wiki/OnPlayerText


Text longer than 144 characters will not show in ClientMessage & ChatBubble
Ohh, didn't know that. Thanks for the heads-up, repped.


Re: Disabling global chat problem - Dayrion - 24.10.2017

Quote:
Originally Posted by RoboN1X
Посмотреть сообщение
Код:
public OnPlayerText(playerid, text[])
{
    new string[144];
    format(string, sizeof(string), "%s says: %s", PlayerName(playerid), text);
    ProxDetector(30.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
    SetPlayerChatBubble(playerid,string,COLOR_WHITE,5.0,5000);
    return 0;
}
https://sampwiki.blast.hk/wiki/OnPlayerText


Text longer than 144 characters will not show in ClientMessage & ChatBubble
Also you might want a different format for your chatbbuble string instead, to not show the player name as the chat bubble appears above the player name, unless you hide the name tags..
He formats the string with more text than player's text, so he can need more than 144