Downgrade this code please..
#1

Код:
    if(!strcmp(cmdtext, "/tc", true, 3))
    {
        if(gTeam[playerid] == TEAM_TERRORISTS)
        {
            new output[255];
            new pname[24];
            new string[128];
            if(!cmdtext[3])return SendClientMessage(playerid, RED, "USAGE: /tc [msg]");
            GetPlayerName(playerid, pname, 24);
            strmid(output,cmdtext,3,strlen(cmdtext));
            format(string, sizeof(string), "TERRORIST-CHAT %s [%d] %s",pname,playerid,output);
            printf("%s", string);
            for(new i=0;i<MAX_PLAYERS;i++)
            {
                   if(gTeam[i] == TEAM_TERRORISTS)
                {
                    format(string, sizeof(string), "(TEAM CHAT) %s [%d] %s",pname,playerid,output);
                    SendClientMessage(i, RED, string);
                }
            }
        }
        else
        {
            SendClientMessage(playerid, RED, "Only Terrorists Can Use This Command!");
        }
        return 1;
    }
How can i combine as many of these as i like insted of making a whole new code for each team,Or do i simpley do under it
Код:
 else if(gTeam[playerid] == TEAM_OTHER)//And so on
this will work right?
Reply
#2

Код:
if(!strcmp(cmdtext, "/tc", true, 3))
    {
        if(gTeam[playerid] == TEAM_TERRORISTS || gTeam[playerid] == TEAM_OTHER || gTeam[playerid] == TEAM_SOMETHING)
        {
// rest of your code
Reply
#3

try with ||


edit: im too late lol :P
Reply
#4

oh yah! xDD *FACEPALM*

Thanks!!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)