SA-MP Forums Archive
[Tutorial] How to make TDM Team Selection. - 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: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] How to make TDM Team Selection. (/showthread.php?tid=658585)

Pages: 1 2


How to make TDM Team Selection. - CaptainBoi - 07.09.2018

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


Re: How to make TDM Team Selection. - RogueDrifter - 08.09.2018

Why don't you try testing that to see if it actually works?

For fucks sake why do people keep posting these shitty threads that don't make any sense.

switch(classid)

then you check for cases 0 and 1 but you only added 221 and 300 what kinda fucked up logic is that? if i could rate it -10 star i would so yeah 1 star from me.


Re: How to make TDM Team Selection. - UFF - 08.09.2018

Donated my eyes after seeing this thread.


Re: How to make TDM Team Selection. - coool - 08.09.2018

Quote:
Originally Posted by RogueDrifter
View Post
Why don't you try testing that to see if it actually works?

For fucks sake why do people keep posting these shitty threads that don't make any sense.

switch(classid)

then you check for cases 0 and 1 but you only added 221 and 300 what kinda fucked up logic is that? if i could rate it -10 star i would so yeah 1 star from me.
Your last sentence is wrong. The switch(classid) code is correct.

OT: Not goodly explained overall.


Re: How to make TDM Team Selection. - ISmokezU - 08.09.2018

Quote:
Originally Posted by coool
View Post
Your last sentence is wrong. The switch(classid) code is correct.

OT: Not goodly explained overall.
He is correct lol.


Re: How to make TDM Team Selection. - xMoBi - 09.09.2018

Use arrays and loops instead.


Re: How to make TDM Team Selection. - BanSilog - 09.09.2018

ZigGamerx he told me he's scripting almost 5 years but he didn't know how to create simple class selection nice

PD: Nice tutorial for newbies Rep


Re: How to make TDM Team Selection. - ZigGamerx - 10.09.2018

Quote:
Originally Posted by CaptainBoi
View Post
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
Dude i didnt say this to make :/

this is team selection i said for Class


Re: How to make TDM Team Selection. - Undef1ned - 10.09.2018

Bad tutorial and badly explained.


Re: How to make TDM Team Selection. - KinderClans - 12.09.2018

Quote:
Originally Posted by UFF
View Post
Donated my eyes after seeing this thread.
laughed my ass off 10 minutes


Re: How to make TDM Team Selection. - UFF - 12.09.2018

Quote:
Originally Posted by ZigGamerx
View Post
Dude i didnt say this to make :/

this is team selection i said for Class
That moment of Captianboi




Re: How to make TDM Team Selection. - Logic_ - 13.09.2018

This is NOT a tutorial and that's my 2 cents.


Re: How to make TDM Team Selection. - AzaMx - 14.09.2018

woow


Re: How to make TDM Team Selection. - ZigGamerx - 14.09.2018

Quote:
Originally Posted by AzaMx
View Post
woow
wow??


Re: How to make TDM Team Selection. - GTLS - 15.09.2018

Its okay. Tutorial is bad but dont worry, you gotta learn it this way. Everyone has to. Accept the criticism and move on and try to be better next time.


Re: How to make TDM Team Selection. - KinderClans - 16.09.2018

Quote:
Originally Posted by GTLS
View Post
Its okay. Tutorial is bad but dont worry, you gotta learn it this way. Everyone has to. Accept the criticism and move on and try to be better next time.
my son could die!


Re: How to make TDM Team Selection. - GTLS - 21.09.2018

Quote:
Originally Posted by KinderClans
View Post
my son could die!
/revive 15

:pce


Re: How to make TDM Team Selection. - Mazio - 21.09.2018

First, I would like to say it's a good try and another thing is that you should post pictures about it and tell us how it looks like.

Ignores those comments and good luck for future.


Re: How to make TDM Team Selection. - CaptainBoi - 22.09.2018

thanks for supporting me well this was just a short tutorial for newbies who are just new.


Re: How to make TDM Team Selection. - solstice_ - 22.09.2018

Quote:
Originally Posted by Mazio
View Post
First, I would like to say it's a good try and another thing is that you should post pictures about it and tell us how it looks like.

Ignores those comments and good luck for future.
This is a "tutorial" (let's say, not really) why put screenshots?

Also,

Quote:
Originally Posted by CaptainBoi
thanks for supporting me well this was just a short tutorial for newbies who are just new.
Well, they won't learn anything new, using this will destroy their code. Sorry to say but it is pretty bad..