SA-MP Forums Archive
Team Chat Help - 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: Team Chat Help (/showthread.php?tid=278899)



Team Chat Help - Tigerbeast11 - 24.08.2011

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-")



Re: Team Chat Help - =WoR=Varth - 24.08.2011

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



Re: Team Chat Help - Tigerbeast11 - 24.08.2011

Thanks!


Re: Team Chat Help - Meller - 12.04.2017

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