Disabling global chat problem
#1

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:

Reply
#2

Код:
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..
Reply
#3

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.
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)