SA-MP Forums Archive
[HELP]/setteam [ID] - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP]/setteam [ID] (/showthread.php?tid=267179)



[HELP]/setteam [ID] - Horrible - 07.07.2011

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?


AW: [HELP]/setteam [ID] - Nero_3D - 07.07.2011

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;
}



Re: AW: [HELP]/setteam [ID] - Horrible - 07.07.2011

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


Re: AW: [HELP]/setteam [ID] - Deviant96 - 09.07.2011

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


AW: [HELP]/setteam [ID] - Nero_3D - 09.07.2011

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;
    }