SA-MP Forums Archive
How To Separate Teams Using Skin ID's? - 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: How To Separate Teams Using Skin ID's? (/showthread.php?tid=336634)



closed. :) - WarriorEd22 - 23.04.2012

closed.


Re: How To Separate Teams Using Skin ID's? - Yuryfury - 23.04.2012

Building off of your previous topic/question:

pawn Код:
#include <a_samp>

new BlueTeamSkin,RedTeamSkin; //We Create Two Variables

#define BlueTeam 1
#define RedTeam 2
//when ever we type BlueTeam, the system reads it as 1
//when ever we type RedTeam, the system reads it as 2

public OnGameModeInit()
{
    BlueTeamSkin = AddPlayerClass(290.......); //Sets this skin as Blue Team Skin
    RedTeamSkin = AddPlayerClass(245.......); //Sets this skin as the Red Team Skin
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    switch (classid)
    {
         case BlueTeamSkin: //If the player chooses the blue team skin...
         {
              GameTextForPlayer(playerid, "~b~Blue Team", 1000, 4);
              SetPlayerTeam(playerid,BlueTeam); //Sets their team to BlueTeam(1)
         }
         case RedTeamSkin: //If the player chooses the red team skin...
         {
              GameTextForPlayer(playerid, "~r~Red Team", 1000, 4);
              SetPlayerTeam(playerid,RedTeam); //Sets their team to RedTeam(2)
         }
    }
    return 1;
}