Chat [REP++]
#1

I have a problem with my chat here is the code
PHP код:
public OnPlayerText(playerid, text[])
{
    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(playerid, pname, 24);
    if(
gTeam[playerid] == TEAM_GS) {
    
format(str, sizeof(str), "%s: {FFFFFF}%s", pname, text);
    
ProxDetector(10.0, playerid, str, COLOR_GREEN, COLOR_GREEN, COLOR_GREEN, COLOR_GREEN, COLOR_GREEN);
    }
    if(
gTeam[playerid] == TEAM_SBF) {
    
format(str, sizeof(str), "%s: {FFFFFF}%s", pname, text);
    
ProxDetector(10.0, playerid, str, COLOR_LIGHTGREEN, COLOR_LIGHTGREEN, COLOR_LIGHTGREEN, COLOR_LIGHTGREEN, COLOR_LIGHTGREEN);
    }
    if(
gTeam[playerid] == TEAM_TDF) {
    
format(str, sizeof(str), "%s: {FFFFFF}%s", pname, text);
    
ProxDetector(10.0, playerid, str, COLOR_DARKGREEN, COLOR_DARKGREEN, COLOR_DARKGREEN, COLOR_DARKGREEN, COLOR_DARKGREEN);
    }
    if(
gTeam[playerid] == TEAM_FYB) {
    
format(str, sizeof(str), "%s: {FFFFFF}%s", pname, text);
    
ProxDetector(10.0, playerid, str, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
    }
    if(
gTeam[playerid] == TEAM_RHB) {
    
format(str, sizeof(str), "%s: {FFFFFF}%s", pname, text);
    
ProxDetector(10.0, playerid, str, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
    }
    if(
gTeam[playerid] == TEAM_KTB) {
    
format(str, sizeof(str), "%s: {FFFFFF}%s", pname, text);
    
ProxDetector(10.0, playerid, str, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
    }
    if(
gTeam[playerid] == TEAM_TDB) {
    
format(str, sizeof(str), "%s: {FFFFFF}%s", pname, text);
    
ProxDetector(10.0, playerid, str, 0xFF80FFFF, 0xFF80FFFF, 0xFF80FFFF, 0xFF80FFFF, 0xFF80FFFF);
    }
    if(
gTeam[playerid] == TEAM_VAGOS) {
    
format(str, sizeof(str), "%s: {FFFFFF}%s", pname, text);
    
ProxDetector(10.0, playerid, str, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
    }
    if(
gTeam[playerid] == TEAM_VARIOS) {
    
format(str, sizeof(str), "%s: {FFFFFF}%s", pname, text);
    
ProxDetector(10.0, playerid, str, 0x00FFFFFF, 0x00FFFFFF, 0x00FFFFFF, 0x00FFFFFF, 0x00FFFFFF);
    }
    if(
gTeam[playerid] == TEAM_DRUG) {
    
format(str, sizeof(str), "%s: {FFFFFF}%s", pname, text);
    
ProxDetector(10.0, playerid, str, 0x970000FF, 0x970000FF, 0x970000FF, 0x970000FF, 0x970000FF);
    }
    if(
gTeam[playerid] == TEAM_GD) {
    
format(str, sizeof(str), "%s: {FFFFFF}%s", pname, text);
    
ProxDetector(10.0, playerid, str, 0xFF8000FF, 0xFF8000FF, 0xFF8000FF, 0xFF8000FF, 0xFF8000FF);
    }
    if(
gTeam[playerid] == TEAM_LSPD) {
    
format(str, sizeof(str), "%s: {FFFFFF}%s", pname, text);
    
ProxDetector(10.0, playerid, str, 0x8080FFFF, 0x8080FFFF, 0x8080FFFF, 0x8080FFFF, 0x8080FFFF);
    }
    if(
gTeam[playerid] == TEAM_HOODRAT) {
    
format(str, sizeof(str), "%s: {FFFFFF}%s", pname, text);
    
ProxDetector(10.0, playerid, str, 0xC0C0C0FF, 0xC0C0C0FF, 0xC0C0C0FF, 0xC0C0C0FF, 0xC0C0C0FF);
    }
    if(
gTeam[playerid] == TEAM_LTMC) {
    
format(str, sizeof(str), "%s: {FFFFFF}%s", pname, text);
    
ProxDetector(10.0, playerid, str, 0x808000FF, 0x808000FF, 0x808000FF, 0x808000FF, 0x808000FF);
    }
    
////////////////////////
    
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)