[Tutorial] Making Skin Selector with gametext & teams[DM]
#1

Introduction
This tutorial shows you how can you add a Screen Message and set player's team while he chooses a skin.
Codes
First of all you have to set teams:
Код:
public OnGameModeInit()
{
SetTeamCount( 1 ); //Change the number "1" depending on the teams you want to have(Number 0 = 1 team/Number 1 = 2 Teams .......)
return 1;
}
Then we have to add skins(https://sampwiki.blast.hk/wiki/Skins:All):
Код:
public OnGameModeInit()
{
AddPlayerClass(115, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0);//terrorist (Team 0)
AddPlayerClass(195, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0);//swat(Team 1)
SetTeamCount( 1 ); //Change the number "1" depending on the teams you want to have(Number 0 = 1 team/Number 1 = 2 Teams .......)
return 1;
}
So after you guys do this you have to change public OnPlayerRequestClass(playerid, classid) code:
Код:
public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	SetCameraBehindPlayer(playerid);
switch(classid)
{
case 0: //The first "AddPlayerClass" you added at "OnGameModeInit()"
{
GameTextForPlayer(playerid,"~r~Terrorist",4000,3);//Screen Message
SetPlayerTeam(playerid, 0 );//Sets Player's TEAM
}
case 1: //The second"AddPlayerClass" you added at "OnGameModeInit()"
{
GameTextForPlayer(playerid,"~r~S.W.A.T",4000,3);//Screen Message
SetPlayerTeam(playerid, 1 );//Sets Player's Team
}
}
return 1;
}
Errors or Problems? let me know
If you face any problems about this please let me know
Reply


Messages In This Thread
Making Skin Selector with gametext & teams[DM] - by [SU]Spartan - 27.09.2014, 10:05
Re: Making Skin Selector with gametext & teams[DM] - by YanLanger - 27.09.2014, 11:26
Re: Making Skin Selector with gametext & teams[DM] - by Godsmazk - 28.09.2014, 04:54
Re: Making Skin Selector with gametext & teams[DM] - by Eth - 28.09.2014, 05:21
Re: Making Skin Selector with gametext & teams[DM] - by LivingLikeYouDo - 28.09.2014, 07:31

Forum Jump:


Users browsing this thread: 1 Guest(s)