Equip Help
#1

Hi!
I need the equip for the the mafia`s / gang`s, like when you go to room with guns(i will make map odchourse), like when you take M4(200 bullets) from equip that costs 200 dollars
And armor is 100 dollars... and that must be in dialog...

Sory about my english..
Thanx!!
Reply
#2

pawn Код:
#define DIALOG_EQUIP 1
pawn Код:
CMD:equip(playerid, params[])
{
    ShowPlayerDialog(playerid, DIALOG_EQUIP, DIALOG_STYLE_LIST, "Weapon shop :", "M4 (200$)\nArmor (100$)", "Purchase", "Cancel");
    return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case DIALOG_EQUIP:
        {
            switch(listitem)
            {
                case 0:
                {
                    if(GetPlayerMoney(playerid) < 200) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                    GivePlayerMoney(playerid, -200);
                    GivePlayerWeapon(playerid, 31, 200);
                }
                case 1:
                {
                    if(GetPlayerMoney(playerid) < 100) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                    GivePlayerMoney(playerid, -100);
                    SetPlayerArmour(playerid, 100);
                }
            }
        }
    }
    return 1;
}
This ?
Reply
#3

No, i need it for RP server(you need to go to hq to equip...) and you can took weapon only at that place(hq)
Reply
#4

pawn Код:
CMD:equip(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 8, x, y, z); // Replace x, y, z by the coordinates of your HQ.
    {
        ShowPlayerDialog(playerid, DIALOG_EQUIP, DIALOG_STYLE_LIST, "Weapon shop :", "M4 (200$)\nArmor (100$)", "Purchase", "Cancel");
    }
    else
        SendClientMessage(playerid, 0xFFFFFFFF, "You're not in the HQ.");
    return 1;
}
You can also add a pickup to know where to use /equip.

pawn Код:
public OnGameModeInit( )
{
    AddStaticPickup(1318, 1, x, y, z, vw); // XYZ coordinates, and vw for virtual world you want to create it.
 
    return 1;
}
Then :

pawn Код:
CMD:equip(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 8, x, y, z); // Replace x, y, z by the coordinates of the pickup.
    {
        ShowPlayerDialog(playerid, DIALOG_EQUIP, DIALOG_STYLE_LIST, "Weapon shop :", "M4 (200$)\nArmor (100$)", "Purchase", "Cancel");
    }
    else
        SendClientMessage(playerid, 0xFFFFFFFF, "You're not in the HQ.");
    return 1;
}
You can use this too :

pawn Код:
new equip;
 
public OnGameModeInit()
{
    equip = CreatePickup(1318, 1, x, y, z, vw); // Replace XYZ coordinates to your HQ.
    return 1;
}
 
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == equip) ShowPlayerDialog(playerid, DIALOG_EQUIP, DIALOG_STYLE_LIST, "Weapon shop :", "M4 (200$)\nArmor (100$)", "Purchase", "Cancel");
   
    return 1;
}
That will open the equipement dialog automatically when the player pick up the pickup.

Sorry, my english is bad. I hope I've helped you.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)