24.04.2012, 15:30
(
Последний раз редактировалось Elysian`; 26.06.2012 в 20:00.
)
Easy Class Selection!
Hello,Today I will teach you how to make easy class selections in a few steps!
Let's get started:
First of all,
You want to use the AddPlayerClass function.
Код:
AddPlayerClass(288,2296.5662,2451.6270,10.8203,87.8270,0,0,0,0,0,0);
After adding your classes you move on to OnPlayerRequestClass. We will be using (switch).
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
switch(classid) // switch between the classid's displayed in OnGameModeInit.
{
case 0, 1: // The number of classes that use this function.
{
//Police Spawn
SetPlayerPos(playerid, 2296.5662,2451.6270, 10.8203); //this is the players position
SetPlayerFacingAngle(playerid, 87.8270); //their facing angle
//Camera Position Police
SetPlayerCameraPos(playerid, 2293.3640,2451.7341,12.8203); //this is the cameras position FACING your skin.
//Police Spawn
SetPlayerCameraLookAt(playerid, 2296.5662,2451.6270, 10.8203); //this is what the camera will look at
PlayerInfo[playerid][Team] = Cops; // if you use a team, This will set them to Team "cops"
}
case 2, 3:
{
SetPlayerPos(playerid, 2516.9578,2447.6992,11.0313); //this is the players position
SetPlayerFacingAngle(playerid, 269.7719); //their facing angle
SetPlayerCameraPos(playerid, 2521.2405,2447.5195,12.0313); //this is the cameras position
SetPlayerCameraLookAt(playerid, 2516.9578,2447.6992,11.0313); //this is what the camera will look at
PlayerInfo[playerid][Team] = Civilian;
}
}
return 1;
}
pawn Код:
ForceClassSelection(playerid);
(First tutorial, no hate?)