Array-Problem
#3

Already fixed it by myself earlier, but thank you anyways!^^ But, I still got another problem which needs to be fixed as soon as possible! After adding some stuff to my gamemode, whatever I say in any team is displayed in an orange color! Usually, the player which is chatting should have HIS color of his team, but it doesn't matter in which team I'm playing, the chat returns always an orange color! Here is the callback for it, what could it cause?

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(PlayerInfo[playerid][pAdmin] == 0 && !IsPlayerAdmin(playerid))
    {
        #if AntiSpam == true
        if(PlayerInfo[playerid][SpamCount] == 0) PlayerInfo[playerid][SpamTime] = TimeStamp();
        PlayerInfo[playerid][SpamCount]++;
        if(TimeStamp() - PlayerInfo[playerid][SpamTime] > SPAM_TIME)
        {
            PlayerInfo[playerid][SpamCount] = 0;
            PlayerInfo[playerid][SpamTime] = TimeStamp();
        }
        else if(PlayerInfo[playerid][SpamCount] == MAX_SPAM_MSG)
        {
            new string[256];
            new name[MAX_PLAYER_NAME];
            GetPlayerName(playerid,name,sizeof(name));
            SpamKickLog(playerid);
            format(string,sizeof(string),"Player %s (ID:%d) has been automatically kicked! (Reason: Spamming)", name,playerid);
            SendClientMessageToAll(COLOR_RED,string);
            Kick(playerid);
        }
        else if(PlayerInfo[playerid][SpamCount] == MAX_SPAM_MSG-1)
        {
            SendClientMessage(playerid,COLOR_RED,"ATTENTION: Next spam warning will result in a kick!");
            return 0;
        }
        #endif
    }
   
    if(text[0] == '#')
    {
        if(PlayerInfo[playerid][pAdmin] >= 1)
        {
            new str[128], name[24];
            GetPlayerName(playerid, name, 24);
            format(str, 128, "[ADMIN CHAT] %s(%d): %s", name,playerid, text[1]);
            SendMessageToAdmins(COLOR_LIGHTBLUE,str);
            return 0;
        }
        return 1;
    }

    new string[256];
        new playername[MAX_PLAYER_NAME];
        if(text[0] == '!' && text[1] != 0)
        {
            GetPlayerName(playerid,playername,MAX_PLAYER_NAME);
            format(string,128,"[Team-Chat] %s: %s", playername,text[1] );
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i) && gTeam[playerid] == gTeam[i])
                    SendClientMessage(i,COLOR_YELLOW,string);
            }
            return 0;
            }


 // I think it starts here...
    new textmsg[128];
    format(textmsg, sizeof(textmsg), "(%d): %s", playerid, text);
    SendPlayerMessageToAll(playerid, textmsg);
    return 0;
}
Reply


Messages In This Thread
Array-Problem - by Twisted_Insane - 19.03.2012, 17:48
Re: Array-Problem - by MP2 - 19.03.2012, 17:54
Re: Array-Problem - by Twisted_Insane - 19.03.2012, 18:04

Forum Jump:


Users browsing this thread: 1 Guest(s)