[HELP]/setteam [ID]
#1

i want like this when someone type /setteam 130 (he will set to team 130)
then when some body type /setteam 130 too,if bot attack both cannot get damage

team 1 - 500

anyone can help?
Reply
#2

That should do it

pawn Код:
CMD:setteam(playerid, team[]) {
    if((team[0] == 0) || ((team[0] == 1) && (team[1] == 0))) { // isnull(team)
        SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /setteam [team]");
    } else {
        team[0] = strval(team);
        if(0 < team[0] <= 500) {
            SetPlayerTeam(playerid, team[0]);
        } else {
            SendClientMessage(playerid, 0xFFFFFFFF, "Invalid team, only 1 - 500");
        }
    }
    return true;
}
Reply
#3

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
That should do it

pawn Код:
CMD:setteam(playerid, team[]) {
    if((team[0] == 0) || ((team[0] == 1) && (team[1] == 0))) { // isnull(team)
        SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /setteam [team]");
    } else {
        team[0] = strval(team);
        if(0 < team[0] <= 500) {
            SetPlayerTeam(playerid, team[0]);
        } else {
            SendClientMessage(playerid, 0xFFFFFFFF, "Invalid team, only 1 - 500");
        }
    }
    return true;
}
TY man
not testes until someone on my server
Reply
#4

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
That should do it

pawn Код:
CMD:setteam(playerid, team[]) {
    if((team[0] == 0) || ((team[0] == 1) && (team[1] == 0))) { // isnull(team)
        SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /setteam [team]");
    } else {
        team[0] = strval(team);
        if(0 < team[0] <= 500) {
            SetPlayerTeam(playerid, team[0]);
        } else {
            SendClientMessage(playerid, 0xFFFFFFFF, "Invalid team, only 1 - 500");
        }
    }
    return true;
}
That's for zcmd, right? Can you give me the strcmp? Thanks before
Reply
#5

yeah, its not hard to change

pawn Код:
//OnPlayerCommandText
    if((strcmp("/setteam", cmdtext, true, 8) == 0) && ((cmdtext[8] == EOS) || (cmdtext[8] == ' '))) {
        if((cmdtext[8] == EOS) || (cmdtext[9] == EOS)) {
            SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /setteam [team]");
        } else {
            cmdtext[0] = strval(cmdtext[9]);
            if(0 < cmdtext[0] <= 500) {
                SetPlayerTeam(playerid, cmdtext[0]);
            } else {
                SendClientMessage(playerid, 0xFFFFFFFF, "Invalid team, only 1 - 500");
            }
        }
        return true;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)