Chat [REP++]
#1

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

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

nothing
Please heeeelp !!
Reply
#4

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

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

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

can you show us your ProxDetector ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)