OnPlayerRequestClass
#3

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;
}
Reply


Messages In This Thread
OnPlayerRequestClass - by trukker1998 - 16.02.2014, 15:16
Re: OnPlayerRequestClass - by Bingo - 16.02.2014, 16:08
Re: OnPlayerRequestClass - by Lordzy - 16.02.2014, 16:58
Re: OnPlayerRequestClass - by trukker1998 - 18.02.2014, 13:15

Forum Jump:


Users browsing this thread: 1 Guest(s)