just one pick...
#1

hello guys after long time i have back on pawno scripting so i need to make the player to can just once to pick weapons so here what i done and what need to do to make that
pawn Код:
CMD:vipguns(playerid, params[])
{
    if(IsPlayerVip[playerid] >= 1)
    {
        ShowPlayerDialog(playerid, vipguns, DIALOG_STYLE_LIST, "Vip Guns", "Sawn-off Shotgun\nTec9\nM4\nAK-47\nSniper\nDesert Eagle\nParachute", "Accept", "Cancel");
        return 1;
    }
    else
    {
        SendClientMessage(playerid, COLOR_WHITE, "You can not use this command. Reason: You are not VIP player.");
        return 1;
    }
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case vipguns:
        {
            if(!response)
            {
                SendClientMessage(playerid, COLOR_ORANGE, "You cancelled.");
                return 1;
            }
            switch(listitem)
            {
                case 0:
                {
                    //Sawn-off Shotgun
                    GivePlayerWeapon(playerid, 26, 500);
                }
                case 1:
                {
                    //tec9
                    GivePlayerWeapon(playerid, 32, 500);
                }
                case 2:
                {
                    //M4
                    GivePlayerWeapon(playerid, 31, 500);
                }
                case 3:
                {
                    //AK-47
                    GivePlayerWeapon(playerid, 30, 500);
                }
                case 4:
                {
                    //sniper
                    GivePlayerWeapon(playerid, 34, 500);
                }
                case 5:
                {
                    //pistol
                    GivePlayerWeapon(playerid, 22, 500);
                }
                case 6:
                {
                    //parachute
                    GivePlayerWeapon(playerid, 46, 500);
                }
                case 7:
                {
                    //MP5
                    GivePlayerWeapon(playerid, 29, 500);
                }
            }
        }
Thanks
Reply
#2

omg me gonna use diz script omg stolen!
No im joking.
You should add a timer between picking each gun..
Reply
#3

mm sorry not explained good ..
dude i need just once to pick this guns in one spawn ....
idk how to explain more good ... :/
Reply
#4

pawn Код:
new bool:Used_VIPGUN[MAX_PLAYERS];

CMD:vipguns(playerid, params[])
{
    if(IsPlayerVip[playerid] >= 1)
    {
        if(Used_VIPGUN[playerid]) return SendClientMessage(playerid, 0xFF0000FF,
        "You already picked one. You can pick another after next Spawn.");
       
        ShowPlayerDialog(playerid, vipguns, DIALOG_STYLE_LIST, "Vip Guns",
        "Sawn-off Shotgun\nTec9\nM4\nAK-47\nSniper\nDesert Eagle\nParachute", "Accept", "Cancel");
       
        return 1;
    }
    else
    {
        SendClientMessage(playerid, COLOR_WHITE,
        "You can not use this command. Reason: You are not VIP player.");
       
        return 1;
    }
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case vipguns:
        {
            if(!response)
            {
                SendClientMessage(playerid, COLOR_ORANGE, "You cancelled.");
                return 1;
            }
            switch(listitem)
            {
                case 0:
                {
                    //Sawn-off Shotgun
                    GivePlayerWeapon(playerid, 26, 500);
                }
                case 1:
                {
                    //tec9
                    GivePlayerWeapon(playerid, 32, 500);
                }
                case 2:
                {
                    //M4
                    GivePlayerWeapon(playerid, 31, 500);
                }
                case 3:
                {
                    //AK-47
                    GivePlayerWeapon(playerid, 30, 500);
                }
                case 4:
                {
                    //sniper
                    GivePlayerWeapon(playerid, 34, 500);
                }
                case 5:
                {
                    //pistol
                    GivePlayerWeapon(playerid, 22, 500);
                }
                case 6:
                {
                    //parachute
                    GivePlayerWeapon(playerid, 46, 500);
                }
                case 7:
                {
                    //MP5
                    GivePlayerWeapon(playerid, 29, 500);
                }
            }
            Used_VIPGUN[playerid] = true;
        }
And make sure you put Used_VIPGUN[playerid] = false; Under OnPlayerSpawn & OnPlayerDisconnect.
Reply
#5

and if i want to make to can pick 3 guns ??
how to do that xD
help pls xD
and sorry to
Reply
#6

pawn Код:
new Guns_Picked[MAX_PLAYERS];

CMD:vipguns(playerid, params[])
{
    if(IsPlayerVip[playerid] >= 1)
    {
        if(Guns_Picked[playerid] >= 3) return SendClientMessage(playerid, 0xFF0000FF,
        "You already picked 3 guns, try again after next Spawn.");

        ShowPlayerDialog(playerid, vipguns, DIALOG_STYLE_LIST, "Vip Guns",
        "Sawn-off Shotgun\nTec9\nM4\nAK-47\nSniper\nDesert Eagle\nParachute", "Accept", "Cancel");

        return 1;
    }
    else
    {
        SendClientMessage(playerid, COLOR_WHITE,
        "You can not use this command. Reason: You are not VIP player.");

        return 1;
    }
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case vipguns:
        {
            if(!response)
            {
                SendClientMessage(playerid, COLOR_ORANGE, "You cancelled.");
                return 1;
            }
            switch(listitem)
            {
                case 0:
                {
                    //Sawn-off Shotgun
                    GivePlayerWeapon(playerid, 26, 500);
                }
                case 1:
                {
                    //tec9
                    GivePlayerWeapon(playerid, 32, 500);
                }
                case 2:
                {
                    //M4
                    GivePlayerWeapon(playerid, 31, 500);
                }
                case 3:
                {
                    //AK-47
                    GivePlayerWeapon(playerid, 30, 500);
                }
                case 4:
                {
                    //sniper
                    GivePlayerWeapon(playerid, 34, 500);
                }
                case 5:
                {
                    //pistol
                    GivePlayerWeapon(playerid, 22, 500);
                }
                case 6:
                {
                    //parachute
                    GivePlayerWeapon(playerid, 46, 500);
                }
                case 7:
                {
                    //MP5
                    GivePlayerWeapon(playerid, 29, 500);
                }
            }
            Guns_Picked[playerid]++;
        }
Use "Guns_Picked[playerid] = 0;" //Under OnPlayerSpawn & OnPlayerDisconnect.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)