i need a tut on how to create team classes
#5

Код:
//top of script
#define TEAM_COP 0
#define TEAM_TAXI 1
under this add

Код:
new gTeam[MAX_PLAYERS];
Some where in script put this NOT UNDER PUBLIC just put somewhere ...
that means if classid will be 0 he will be in team ''COP'' if he will be other skin he will be in team TAXI

Код:
SetPlayerTeamFromClass(playerid, classid)
{
	if (classid == 0)
	{
		gTeam[playerid] = TEAM_COP;
	}
	else
	{
		gTeam[playerid] = TEAM_TAXI;
	}
}
if you have more skins USE THIS!!!

Код:
SetPlayerTeamFromClass(playerid, classid)
{
	if (classid == 0)
	{
		gTeam[playerid] = TEAM_GROVE;
	}
	if(classid == 1)
	{
		gTeam[playerid] = TEAM_BALLA;
	}
    //if(classid == 1,2,3,4,5)
    //{
    // code
    //}
}
put this under OnPlayerRequestClass
Код:
SetPlayerTeamFromClass(playerid, classid);
Than let our teams have colours:

add this SOMEWHERE IN SCRIPT NOT UNDER PUBLIC

Код:
SetPlayerToTeamColor(playerid)
{
	if (gTeam[playerid] == TEAM_COP)
	{
		SetPlayerColor(playerid, put here your colour); // perfer blue
	}
	else if (gTeam[playerid] == TEAM_TAXI)
	{
		SetPlayerColor(playerid, put here your colour); // perfer green
	}
}
EDIT: and under OnPlayerSpawn add this: so when you will spawn it will set them to their colors...
Код:
SetPlayerToTeamColor(playerid);
and this if for you

scroll down a bit and you will find tutorial! How to make teams
https://sampwiki.blast.hk/wiki/PAWN_tutorial

and for other things
http://wiki.sa-mp.com

its the same page btw

have a nice day
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)