Requesting help with OnPlayerRequestClass
#4

Then try this:
pawn Код:
#define TEAM_COPS1 0
#define TEAM_COPS2 1
#define TEAM_CIVILIAN 2
#define TEAM_ROBBERS 3

#define DIALOG_CLASS 3

static Team[MAX_PLAYERS];
public OnGameModeInit()
{
    SetGameModeText("TR-CR v1.0");
    AddPlayerClass(280, 1525.697265, -1677.923706, 5.890625, 265.247283, 5,1,22,1000,30,1000);
    AddPlayerClass(287,1568.449707, -1690.995849, 5.890625, 180.959609,5,1,22,1000,30,1000);
    AddPlayerClass(217,1642.000122, -2334.761474, 13.546875, 354.693267,29,500,33,500,24,320);
    AddPlayerClass(115,2520.769775, -1678.817016, 15.176570, 88.838874,29,500,34,280,23,450);
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    ShowPlayerDialog(playerid, DIALOG_CLASS, DIALOG_STYLE_LIST, "{555555}Teams", "{0909F7}LSPD Officer\n{AEA551}Army Soldier\n{CCCCCC}Civilian\n{F72009}Robbers", "Choose", "Kick");
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_CLASS)
    {
        if(!response) return Kick(playerid);
        switch(listitem)
        {
            case: 0
            {
                SpawnPlayer(playerid);
                Team[playerid] = TEAM_COPS1;
                SetPlayerPos(playerid, 1525.697265, -1677.923706, 5.890625);
                SetPlayerSkin(playerid, 280);
            }
            case: 1
            {
                SpawnPlayer(playerid);
                Team[playerid] = TEAM_COPS2;
                SetPlayerPos(playerid, 1568.449707, -1690.995849, 5.890625);
                SetPlayerSkin(playerid, 287);
            }
            case: 2
            {
                SpawnPlayer(playerid);
                Team[playerid] = TEAM_CIVILIAN;
                SetPlayerPos(playerid, 1642.000122, -2334.761474, 13.546875);
                SetPlayerSkin(playerid, 217);
            }
            case: 3
            {
                SpawnPlayer(playerid);
                Team[playerid] = TEAM_ROBBERS;
                SetPlayerPos(playerid, 2520.769775, -1678.817016, 15.176570);
                SetPlayerSkin(playerid, 115);
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
Requesting help with OnPlayerRequestClass - by Magic_Time - 31.01.2013, 21:44
Re: Requesting help with OnPlayerRequestClass - by Roach_ - 31.01.2013, 21:51
Re: Requesting help with OnPlayerRequestClass - by Magic_Time - 31.01.2013, 22:06
Re: Requesting help with OnPlayerRequestClass - by Roach_ - 31.01.2013, 22:14

Forum Jump:


Users browsing this thread: 1 Guest(s)