Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- // The teams
- #define TEAM_BLUE 1
- #define TEAM_GREEN 2
- // Colours of the teams
- #define TEAM_BLUE_COLOUR 0x0000BBAA // Team Blue
- #define TEAM_GREEN_COLOUR 0x33AA33AA // Team Green
- // Can get in which team the player is
- new gTeam[MAX_PLAYERS];
- main()
- {
- print("\n----------------------------------");
- print("Team script made by Naoufal");
- print("----------------------------------\n");
- }
- public OnGameModeInit()
- {
- SetGameModeText("Teams");
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); // blue team
- AddPlayerClass(1, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); // green team
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerTeamFromClass(playerid, classid);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- SetPlayerToTeamColour(playerid);
- return 1;
- }
- SetPlayerTeamFromClass(playerid, classid)
- {
- if(classid == 0)
- {
- gTeam[playerid] = TEAM_BLUE; // This is using the defines of Team Blue
- }
- else if(classid == 1)
- {
- gTeam[playerid] = TEAM_GREEN; // This is using the defines of Team Green
- }
- }
- SetPlayerToTeamColour(playerid)
- {
- if(gTeam[playerid] == TEAM_BLUE)
- {
- SetPlayerColor(playerid,TEAM_BLUE_COLOUR); // Color of the player in team green
- }
- else if(gTeam[playerid] == TEAM_GREEN)
- {
- SetPlayerColor(playerid,TEAM_GREEN_COLOUR); // Color of the player in team green
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement