Team Chat Help
#1

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(text[0] == "*") //Error line
    {
        if(Team[playerid] == TEAM_BLUE)
        {
            for(new i = 0; i < MAX_PLAYERS; i++)
            if(IsPlayerConnected(i) && Team[i] == TEAM_BLUE || GetPVarInt(i,"VIP") == 1 || GetPVarInt(i,"Admin") == 1)
            {
                new string[128];
                new name[24];
                GetPlayerName(playerid,name,24);
                format(string,128,"[BLUE TEAM CHAT]%s [ID:%d]: %s",name,playerid,text[1]);
                SendClientMessage(i,grey,string);
                return 0;
            }
        }
        else
        {
            for(new i = 0; i < MAX_PLAYERS; i++)
            if(IsPlayerConnected(i) && Team[i] == TEAM_RED || GetPVarInt(i,"VIP") == 1 || GetPVarInt(i,"Admin") == 1)
            {
                new string[128];
                new name[24];
                GetPlayerName(playerid,name,24);
                format(string,128,"[RED TEAM CHAT]%s [ID:%d]: %s",name,playerid,text[1]);
                SendClientMessage(i,grey,string);
                return 0;
            }
        }
    }
    return 1;
}
Код:
cod5.pwn(209) : error 033: array must be indexed (variable "-unknown-")
Reply
#2

pawn Код:
if(!strcmp(text,"*"))
Reply
#3

Thanks!
Reply
#4

you cant use == operators for a string.














































Just wanted to piss off some ez triggered people around here that will spam reply "nice bump". love u
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)