Weapon Dialog - PAYING
#3

pawn Код:
#include <a_samp>
#define TEAM_COP 0
#define TEAM_SWAT 1
#define TEAM_ARMY 2

enum
{
    DIALOG_WEAPONS
}

new listitemSwitch[6][2][0] = {
{"M4A1", 31},
{"Sawnoff", 26},
{"Tec-9", 32},
{"MP5", 29},
{"Uzi", 28},
{"Sniper Rifle", 34}
};

public OnGameModeInit()
{
    new i;
    for(i = 0; i < MAX_PLAYERS; i++) {
    SetPlayerCheckpoint(i, 2722.6714,-2385.0588,17.3403, 5.0); }
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    new stringW[256];
    switch (GetPlayerTeam(playerid))
    {
        case TEAM_COP, TEAM_ARMY, TEAM_SWAT: {
            for(new i = 0; i < sizeof(listitemSwitch); i++) {
                format(stringW, sizeof(stringW), "%s\n", listitemSwitch[i][0]);
            }
            ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapons", stringW, "Get weapon", "Cancel");
        }
    }
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_WEAPONS)
    {
        if(response)
        {
            GivePlayerWeapon(playerid, strval(listitemSwitch[listitem][1]), 1000);
        }
        return 1;
    }
    return 0;
}
Reply


Messages In This Thread
---------- - by K3nX - 11.04.2013, 13:22
Re: Weapon Dialog - PAYING - by Isolated - 11.04.2013, 13:32
Re: Weapon Dialog - PAYING - by [XST]O_x - 11.04.2013, 13:44
---------- - by K3nX - 11.04.2013, 15:01
Re: Weapon Dialog - PAYING - by [XST]O_x - 11.04.2013, 15:07
---------- - by K3nX - 11.04.2013, 15:08
Re: Weapon Dialog - PAYING - by [XST]O_x - 11.04.2013, 15:12
---------- - by K3nX - 11.04.2013, 15:35
Re: Weapon Dialog - PAYING - by [FSaF]Jarno - 11.04.2013, 15:43
Re: Weapon Dialog - PAYING - by [XST]O_x - 11.04.2013, 15:54

Forum Jump:


Users browsing this thread: 3 Guest(s)