27.09.2014, 10:05
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:
Then we have to add skins(https://sampwiki.blast.hk/wiki/Skins:All):
So after you guys do this you have to change public OnPlayerRequestClass(playerid, classid) code:
Errors or Problems? let me know
If you face any problems about this please let me know
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; }
Код:
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; }
Код:
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; }
If you face any problems about this please let me know