SA-MP Forums Archive
Chat [REP++] - 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: Chat [REP++] (/showthread.php?tid=550505)



Chat [REP++] - nezo2001 - 13.12.2014

I have a problem with my chat here is the code
PHP код:
public OnPlayerText(playeridtext[])
{
    if(
Muted[playerid] == 1)
    {
        
SendClientMessage(playerid,0x3FA63CFF,"You're muted by an Administrator, you may not speak.");
        return 
0;
        }
    new 
pname[24], str[128];
    
GetPlayerName(playeridpname24);
    if(
gTeam[playerid] == TEAM_GS) {
    
format(strsizeof(str), "%s: {FFFFFF}%s"pnametext);
    
ProxDetector(10.0playeridstrCOLOR_GREENCOLOR_GREENCOLOR_GREENCOLOR_GREENCOLOR_GREEN);
    }
    if(
gTeam[playerid] == TEAM_SBF) {
    
format(strsizeof(str), "%s: {FFFFFF}%s"pnametext);
    
ProxDetector(10.0playeridstrCOLOR_LIGHTGREENCOLOR_LIGHTGREENCOLOR_LIGHTGREENCOLOR_LIGHTGREENCOLOR_LIGHTGREEN);
    }
    if(
gTeam[playerid] == TEAM_TDF) {
    
format(strsizeof(str), "%s: {FFFFFF}%s"pnametext);
    
ProxDetector(10.0playeridstrCOLOR_DARKGREENCOLOR_DARKGREENCOLOR_DARKGREENCOLOR_DARKGREENCOLOR_DARKGREEN);
    }
    if(
gTeam[playerid] == TEAM_FYB) {
    
format(strsizeof(str), "%s: {FFFFFF}%s"pnametext);
    
ProxDetector(10.0playeridstrCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE);
    }
    if(
gTeam[playerid] == TEAM_RHB) {
    
format(strsizeof(str), "%s: {FFFFFF}%s"pnametext);
    
ProxDetector(10.0playeridstrCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE);
    }
    if(
gTeam[playerid] == TEAM_KTB) {
    
format(strsizeof(str), "%s: {FFFFFF}%s"pnametext);
    
ProxDetector(10.0playeridstrCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE);
    }
    if(
gTeam[playerid] == TEAM_TDB) {
    
format(strsizeof(str), "%s: {FFFFFF}%s"pnametext);
    
ProxDetector(10.0playeridstr0xFF80FFFF0xFF80FFFF0xFF80FFFF0xFF80FFFF0xFF80FFFF);
    }
    if(
gTeam[playerid] == TEAM_VAGOS) {
    
format(strsizeof(str), "%s: {FFFFFF}%s"pnametext);
    
ProxDetector(10.0playeridstrCOLOR_YELLOWCOLOR_YELLOWCOLOR_YELLOWCOLOR_YELLOWCOLOR_YELLOW);
    }
    if(
gTeam[playerid] == TEAM_VARIOS) {
    
format(strsizeof(str), "%s: {FFFFFF}%s"pnametext);
    
ProxDetector(10.0playeridstr0x00FFFFFF0x00FFFFFF0x00FFFFFF0x00FFFFFF0x00FFFFFF);
    }
    if(
gTeam[playerid] == TEAM_DRUG) {
    
format(strsizeof(str), "%s: {FFFFFF}%s"pnametext);
    
ProxDetector(10.0playeridstr0x970000FF0x970000FF0x970000FF0x970000FF0x970000FF);
    }
    if(
gTeam[playerid] == TEAM_GD) {
    
format(strsizeof(str), "%s: {FFFFFF}%s"pnametext);
    
ProxDetector(10.0playeridstr0xFF8000FF0xFF8000FF0xFF8000FF0xFF8000FF0xFF8000FF);
    }
    if(
gTeam[playerid] == TEAM_LSPD) {
    
format(strsizeof(str), "%s: {FFFFFF}%s"pnametext);
    
ProxDetector(10.0playeridstr0x8080FFFF0x8080FFFF0x8080FFFF0x8080FFFF0x8080FFFF);
    }
    if(
gTeam[playerid] == TEAM_HOODRAT) {
    
format(strsizeof(str), "%s: {FFFFFF}%s"pnametext);
    
ProxDetector(10.0playeridstr0xC0C0C0FF0xC0C0C0FF0xC0C0C0FF0xC0C0C0FF0xC0C0C0FF);
    }
    if(
gTeam[playerid] == TEAM_LTMC) {
    
format(strsizeof(str), "%s: {FFFFFF}%s"pnametext);
    
ProxDetector(10.0playeridstr0x808000FF0x808000FF0x808000FF0x808000FF0x808000FF);
    }
    
////////////////////////
    
return 0//

When i type anything nothing happen and no thing apear please help.


Re: Chat [REP++] - Galletziz - 13.12.2014

try to change return 0 to:
pawn Код:
return 1;



Re: Chat [REP++] - nezo2001 - 13.12.2014

nothing
Please heeeelp !!


Re: Chat [REP++] - Raweresh - 13.12.2014

Maybe you are not in any team. And how nothing? When you return 1 in OnPlayerText then you see default message at chat.


Re: Chat [REP++] - nezo2001 - 13.12.2014

it was working btw why it doesn't work when i changed the return to 1 ??


Re: Chat [REP++] - Sledgehammer - 13.12.2014

https://sampwiki.blast.hk/wiki/OnPlayerText
Quote:

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

I see nothing wrong with your code.


Re: Chat [REP++] - amirab - 13.12.2014

can you show us your ProxDetector ?