SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Tutorials

Reply
 
Thread Tools Display Modes
Old 07/09/2018, 05:17 PM   #1
CaptainBoi
Huge Clucker
 
CaptainBoi's Avatar
 
Join Date: May 2018
Location: Inside Game
Posts: 235
Reputation: 25
Default How to make TDM Team Selection.

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
__________________
Code:
Releases
[FilterScript] Dynamic MySQL GPS System
[Tutorial] How to make TDM Team Selection.
[Include] moneybar.inc || Coloured Moneybar || Released
[Tutorial] PAWN Compiler In Notepad++
[FilterScript] Perks System (v: [On Update]) [DINI, ZCMD]
[FilterScript] Realistic Transmission Speedometer
CaptainBoi is offline   Reply With Quote
Old 08/09/2018, 04:35 PM   #2
RogueDrifter
High-roller
 
RogueDrifter's Avatar
 
Join Date: Dec 2017
Location: SA-MP Drifting world.
Posts: 1,170
Reputation: 379
Default Re: How to make TDM Team Selection.

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.
__________________
Be creative.

[Github]:Link [Gists]:Link [Forum]:Link [Server]:Link [Discord]:Link


RogueDrifter is offline   Reply With Quote
Old 08/09/2018, 04:39 PM   #3
UFF
Banned
 
Join Date: Feb 2018
Location: Funky World
Posts: 357
Reputation: 28
Default Re: How to make TDM Team Selection.

Donated my eyes after seeing this thread.
UFF is offline   Reply With Quote
Old 08/09/2018, 04:44 PM   #4
coool
Gangsta
 
coool's Avatar
 
Join Date: Feb 2013
Location: Republic of Pakistan
Posts: 575
Reputation: 53
Default Re: How to make TDM Team Selection.

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.
__________________
coool is offline   Reply With Quote
Old 08/09/2018, 05:18 PM   #5
ISmokezU
Gangsta
 
Join Date: Aug 2016
Posts: 544
Reputation: 73
Default Re: How to make TDM Team Selection.

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.
ISmokezU is offline   Reply With Quote
Old 09/09/2018, 02:26 AM   #6
xMoBi
Banned
 
Join Date: Jul 2017
Location: Islamic Republic of Pakistan
Posts: 102
Reputation: 26
Default Re: How to make TDM Team Selection.

Use arrays and loops instead.
xMoBi is offline   Reply With Quote
Old 09/09/2018, 06:16 AM   #7
BanSilog
Big Clucker
 
BanSilog's Avatar
 
Join Date: Nov 2017
Location: Philippines
Posts: 98
Reputation: 16
Default Re: How to make TDM Team Selection.

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
BanSilog is offline   Reply With Quote
Old 10/09/2018, 09:37 AM   #8
ZigGamerx
Big Clucker
 
ZigGamerx's Avatar
 
Join Date: Jul 2018
Posts: 187
Reputation: 23
Default Re: How to make TDM Team Selection.

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
ZigGamerx is online now   Reply With Quote
Old 10/09/2018, 07:59 PM   #9
Undef1ned
Huge Clucker
 
Undef1ned's Avatar
 
Join Date: Aug 2018
Posts: 222
Reputation: 18
Default Re: How to make TDM Team Selection.

Bad tutorial and badly explained.
Undef1ned is offline   Reply With Quote
Old 12/09/2018, 08:25 PM   #10
KinderClans
Banned
 
Join Date: May 2018
Location: Italy
Posts: 728
Reputation: 43
Default Re: How to make TDM Team Selection.

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

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Team Selection and Class Selection CrazyPerry Scripting Help 1 10/11/2017 06:32 PM
[Q]Proper way to make team selection Dziugsas Scripting Help 0 14/08/2015 05:19 PM
Make team + class selection appear at connect Eminem 2ka9 Scripting Help 3 10/03/2013 01:25 AM
How to Make Text for Team Selection? ServerScripter Scripting Help 20 25/01/2012 01:01 PM
[HELP] How make single team players selection menu??? vakhtang Help Archive 0 29/12/2010 06:00 PM


All times are GMT. The time now is 11:44 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.