17.09.2012, 08:05
Example:
pawn Code:
public OnPlayerRequestClass(playerid, classid) //When a player selects a class
{
if(classid == 0) //Let's say our first skin is a 'Grove Street' skin
{
SetPlayerPos(playerid, X, Y, Z); //We replace X, Y and Z with our Grove Street coordinates
SetPlayerFacingAngle(playerid, 0); //Can change to any angle you want, not necessary, but recommended for accuracy
SetPlayerCameraPos(playerid, X, Y, Z); //Replace X, Y and Z where you want the player to be looking from. These will also be in or near Grove Street, player must be visible from this point.
SetPlayerCameraLookAt(playerid, X, Y, Z); //X Y and Z are taken from our SetPlayerPos coordinates, so the camera is looking AT the player's position.
GameTextForPlayer(playerid, "~g~Grove Street", 5000, 5); //Optional, but explains what the class is.
}
else if(classid == 1) //Ballas team for example
{
SetPlayerPos(playerid, X, Y, Z); //Position set to a Ballas area.
SetPlayerFacingAngle...
SetPlayerCameraPos(... //Near the player position
SetPlayerCameraLookAt(.... //Look at the player
GameTextForPlayer(....
}
return 1;
}