Set team
#1

Ok, so im making a /setteam and if the player types /setteam 1 it changes to the team mexicans and spawns him.

pawn Код:
switch(Info[playerid][Team])
    {
        case Mexicans:
        {
            SetPlayerPos(playerid,2265.6785,-1027.3943,59.2879); // team 1
            SetPlayerFacingAngle(playerid,303.9446);
            GivePlayerWeapon(playerid,24,100);
            GivePlayerWeapon(playerid,30,1000);
            GivePlayerWeapon(playerid,28,1000);
            SetPlayerColor(playerid,COLOR_MEXICAN);
            Update3DTextLabelText(Info[playerid][team_label], COLOR_MEXICAN, "Mexican");
        }
        case Americans: // team 2
        {
            SetPlayerPos(playerid,2433.3965,-1671.5343,13.5938);
            SetPlayerFacingAngle(playerid,88.8288);
            GivePlayerWeapon(playerid,10,1);
            GivePlayerWeapon(playerid,22,1000);
            GivePlayerWeapon(playerid,25,1000);
            GivePlayerWeapon(playerid,29,1000);
            SetPlayerColor(playerid,COLOR_AMERICAN);
            Update3DTextLabelText(Info[playerid][team_label], COLOR_AMERICAN, "American");
        }
        case BP: //team 3
        {
            SetPlayerPos(playerid,1568.3203,-1693.0808,5.8906);
            SetPlayerFacingAngle(playerid,179.8611);
            GivePlayerWeapon(playerid,23,100);
            GivePlayerWeapon(playerid,29,1000);
            GivePlayerWeapon(playerid,31,1000);
            SetPlayerColor(playerid,COLOR_BP);
            Update3DTextLabelText(Info[playerid][team_label], COLOR_BP, "Border Patrol");
        }
Here is the team info

and all i have so far lol
pawn Код:
CMD:setteam(playerid. params[])
{
    if(!IsAdmin(playerid, 3)) return ErrorMsg(playerid);

    new teamid;
    if(sscanf(params, "i", teamid)) return Usage(playerid, "/SetTeam [team id]");
   
        //the rest here

    return 1;
}
Reply
#2

cool? What are we supposed to "do" with this? I don't think there's much to discuss about this; it has no point in being realised and if you are looking for suggestions you should state so in your post?

As a additional suggestion, make sure it's not usable when in X radius of enemies / or being shot at.
Reply
#3

pawn Код:
CMD:setteam(playerid. params[])
{
    if(!IsAdmin(playerid, 3)) return ErrorMsg(playerid);
    new teamid;
    if(sscanf(params, "i", teamid)) return Usage(playerid, "/SetTeam [1 = Mexicans | 2 = Americans | 3 = BP's]");
    switch(teamid)
    {
        case 1:
        {
            SetPlayerPos(playerid,2265.6785,-1027.3943,59.2879); // team 1
            SetPlayerFacingAngle(playerid,303.9446);
            GivePlayerWeapon(playerid,24,100);
            GivePlayerWeapon(playerid,30,1000);
            GivePlayerWeapon(playerid,28,1000);
            SetPlayerColor(playerid,COLOR_MEXICAN);
            Update3DTextLabelText(Info[playerid][team_label], COLOR_MEXICAN, "Mexican");
            Info[playerid][Team] = Mexicans;
        }
        case 2: // team 2
        {
            SetPlayerPos(playerid,2433.3965,-1671.5343,13.5938);
            SetPlayerFacingAngle(playerid,88.8288);
            GivePlayerWeapon(playerid,10,1);
            GivePlayerWeapon(playerid,22,1000);
            GivePlayerWeapon(playerid,25,1000);
            GivePlayerWeapon(playerid,29,1000);
            SetPlayerColor(playerid,COLOR_AMERICAN);
            Update3DTextLabelText(Info[playerid][team_label], COLOR_AMERICAN, "American");
            Info[playerid][Team] = Americans;
        }
        case 3: //team 3
        {
            SetPlayerPos(playerid,1568.3203,-1693.0808,5.8906);
            SetPlayerFacingAngle(playerid,179.8611);
            GivePlayerWeapon(playerid,23,100);
            GivePlayerWeapon(playerid,29,1000);
            GivePlayerWeapon(playerid,31,1000);
            SetPlayerColor(playerid,COLOR_BP);
            Update3DTextLabelText(Info[playerid][team_label], COLOR_BP, "Border Patrol");
            Info[playerid][Team] = BP;
        }
    }
    return 1;
}
Reply
#4

Quote:
Originally Posted by FireCat
Посмотреть сообщение
pawn Код:
CMD:setteam(playerid. params[])
{
    if(!IsAdmin(playerid, 3)) return ErrorMsg(playerid);
    new teamid;
    if(sscanf(params, "i", teamid)) return Usage(playerid, "/SetTeam [1 = Mexicans | 2 = Americans | 3 = BP's]");
    switch(teamid)
    {
        case 1:
        {
            SetPlayerPos(playerid,2265.6785,-1027.3943,59.2879); // team 1
            SetPlayerFacingAngle(playerid,303.9446);
            GivePlayerWeapon(playerid,24,100);
            GivePlayerWeapon(playerid,30,1000);
            GivePlayerWeapon(playerid,28,1000);
            SetPlayerColor(playerid,COLOR_MEXICAN);
            Update3DTextLabelText(Info[playerid][team_label], COLOR_MEXICAN, "Mexican");
            Info[playerid][Team] = Mexicans;
        }
        case 2: // team 2
        {
            SetPlayerPos(playerid,2433.3965,-1671.5343,13.5938);
            SetPlayerFacingAngle(playerid,88.8288);
            GivePlayerWeapon(playerid,10,1);
            GivePlayerWeapon(playerid,22,1000);
            GivePlayerWeapon(playerid,25,1000);
            GivePlayerWeapon(playerid,29,1000);
            SetPlayerColor(playerid,COLOR_AMERICAN);
            Update3DTextLabelText(Info[playerid][team_label], COLOR_AMERICAN, "American");
            Info[playerid][Team] = Americans;
        }
        case 3: //team 3
        {
            SetPlayerPos(playerid,1568.3203,-1693.0808,5.8906);
            SetPlayerFacingAngle(playerid,179.8611);
            GivePlayerWeapon(playerid,23,100);
            GivePlayerWeapon(playerid,29,1000);
            GivePlayerWeapon(playerid,31,1000);
            SetPlayerColor(playerid,COLOR_BP);
            Update3DTextLabelText(Info[playerid][team_label], COLOR_BP, "Border Patrol");
            Info[playerid][Team] = BP;
        }
    }
    return 1;
}
Thanks worked perfect
Reply
#5

Add SetPlayerTeam(playerid, Info[playerid][Team]); before the return 1
Reply
#6

Quote:
Originally Posted by SnG.Scot_MisCuDI
Посмотреть сообщение
Cool why not get that dick outta your ass. Its obvious.
I wonder what i would need help with, with the command setteam?



Thanks im testing now
Not my problem you post posts and edit them later mate.
Insulting someone who is trying to help you isn't very polite either.

Besides; No error codes were posted and I'm not a mind reader, bru.
Reply
#7

Quote:
Originally Posted by [ABK]Antonio
Посмотреть сообщение
Add SetPlayerTeam(playerid, Info[playerid][Team]); before the return 1
Lol i should've been on xfire. thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)