10.09.2018, 09:37
Quote:
|
Introduction:
Tutorial Getting Started: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: ![]() 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> -Define team names with id's. Code:
#define TEAM_0 0 #define TEAM_1 1 -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 -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;
}
-Now we will spawn that player on selecting the team and giving him the colour and text. Code:
public OnPlayerRequestClass(playerid, classid) Code:
switch(classid) -Now we will put case so we can make the teams available in the team selection menu. Code:
case 0: Code:
GameTextForPlayer(playerid, "Team 0", 300, 3);
SetPlayerPos(playerid, 'Your Spawn Position');
SetPlayerTeam(playerid, TEAM_0);
SetPlayerColor(playerid, 0xFFFFFF00);
Code:
case 1: Code:
GameTextForPlayer( playerid, "Team 1", 300, 3 );
SetPlayerPos(playerid, 'Your Spawn Position');
SetPlayerTeam(playerid, TEAM_1);
SetPlayerColor(playerid, 0x00CBCB00);
|
this is team selection i said for Class



