[Tutorial] How to make TDM Team Selection.
#1

Introduction:
Hello Guys! Welcome in my another tutorial in this tutorial i am gonna show you how to make team selection for TDM scripts. Well this tutorial was requested by a guy check him below.

Requested By:
Tutorial Getting Started:
So here we get start for the tutorial just read out the following steps and you will be done.

Step 1:
-Add include of samp
Code:
#include <a_samp>
Step 2:
-Define team names with id's.
Code:
#define TEAM_0 0
#define TEAM_1 1
Step 3:
-I have made few defines for spawn skin selection
so we dont need to make the coords again and again.
Code:
#define SPAWN_X -1804.0979
#define SPAWN_Y 13.5469
#define SPAWN_Z 270.1467
Step 4:
-Now we gonna add classes with the skin id's.
-Put the SPAWN_X, SPAWN_Y, SPAWN_Z in X, Y, Z so when player request for a class he will get to that location for selection of teams.
Code:
public OnGameModeInit()
{
    //Team 0
	AddPlayerClass(221, SPAWN_X, SPAWN_Y, SPAWN_Z,90.9417,24,100,30,500,34,100);
	//Team 1
	AddPlayerClass(300, SPAWN_X, SPAWN_Y, SPAWN_Z,90.9417,24,100,30,500,34,100);
	return 1;
}
Step 5:
-Now we will spawn that player on selecting the team and giving him the colour and text.
Code:
public OnPlayerRequestClass(playerid, classid)
-Put this switch so when player click next previous button he can able see this 2 teams only.
Code:
switch(classid)
Step 6:
-Now we will put case so we can make the teams available in the team selection menu.
Code:
case 0:
-Case 0 will make the team 0 and now when player selects team 0 we will give him spawn location and gametext of team id.
Code:
GameTextForPlayer(playerid, "Team 0", 300, 3);
            SetPlayerPos(playerid, 'Your Spawn Position');
            SetPlayerTeam(playerid, TEAM_0);
            SetPlayerColor(playerid, 0xFFFFFF00);
-Now we will use another case if player selects another skin we will set his team color.
Code:
case 1:
-We gotta use cases for that much teams you had added.
Code:
GameTextForPlayer( playerid, "Team 1", 300, 3 );
            SetPlayerPos(playerid, 'Your Spawn Position');
            SetPlayerTeam(playerid, TEAM_1); 
            SetPlayerColor(playerid, 0x00CBCB00);
Hope you like the tutorial
Reply


Messages In This Thread
How to make TDM Team Selection. - by CaptainBoi - 07.09.2018, 17:17
Re: How to make TDM Team Selection. - by RogueDrifter - 08.09.2018, 16:35
Re: How to make TDM Team Selection. - by UFF - 08.09.2018, 16:39
Re: How to make TDM Team Selection. - by coool - 08.09.2018, 16:44
Re: How to make TDM Team Selection. - by ISmokezU - 08.09.2018, 17:18
Re: How to make TDM Team Selection. - by xMoBi - 09.09.2018, 02:26
Re: How to make TDM Team Selection. - by BanSilog - 09.09.2018, 06:16
Re: How to make TDM Team Selection. - by ZigGamerx - 10.09.2018, 09:37
Re: How to make TDM Team Selection. - by Undef1ned - 10.09.2018, 19:59
Re: How to make TDM Team Selection. - by KinderClans - 12.09.2018, 20:25
Re: How to make TDM Team Selection. - by UFF - 12.09.2018, 20:50
Re: How to make TDM Team Selection. - by Logic_ - 13.09.2018, 16:07
Re: How to make TDM Team Selection. - by AzaMx - 14.09.2018, 10:06
Re: How to make TDM Team Selection. - by ZigGamerx - 14.09.2018, 10:28
Re: How to make TDM Team Selection. - by GTLS - 15.09.2018, 13:51
Re: How to make TDM Team Selection. - by KinderClans - 16.09.2018, 19:38
Re: How to make TDM Team Selection. - by GTLS - 21.09.2018, 12:48
Re: How to make TDM Team Selection. - by Mazio - 21.09.2018, 12:53
Re: How to make TDM Team Selection. - by CaptainBoi - 22.09.2018, 21:07
Re: How to make TDM Team Selection. - by solstice_ - 22.09.2018, 21:47
Re: How to make TDM Team Selection. - by CaptainBoi - 22.09.2018, 22:30

Forum Jump:


Users browsing this thread: 1 Guest(s)