16.02.2014, 16:58
You can get that performed under OnPlayerSpawn. Use arrays to determine what class the player has chosen.
pawn Код:
new
p_Class[MAX_PLAYERS];
public OnPlayerRequestClass(playerid, classid)
{
p_Class[playerid] = classid; //Sets the classid of the player.
SetPlayerPos(playerid, 180.892608, 1830.717895, 23.242187);
SetPlayerFacingAngle(playerid, 255.810241);
SetPlayerCameraLookAt(playerid, 180.892608, 1830.717895, 23.242187);
SetPlayerCameraPos(playerid, 180.892608 + (5 * floatsin(-255.810241, degrees)), 1830.717895 + (5 * floatcos(-255.810241, degrees)), 23.242187);
switch(classid)
{
case 0:
{
SetPlayerTeam(playerid, TEAMRed);
SendClientMessageToAll(COLOR_RED, "I will write a message here");
GameTextForPlayer(playerid, "~r~Red", 1000, 3);
}
case 1:
{
SetPlayerTeam(playerid, TEAMBlue);
SendClientMessageToAll(COLOR_BLUE, "I will write a message here");
GameTextForPlayer(playerid, "~b~Blue", 1000, 3);
}
}
return 1;
}
public OnPlayerSpawn(playerid)
{
switch(p_Class[playerid]) {
case 0 : SendClientMessage(playerid, -1, "Hello, welcome to Team Red!"); //You can replace these messages, it's just an example.
case 1 : SendClientMessage(playerid, -1, "Hello, welcome to Team Blue!");
}
//Rest codes.
return 1;
}