Equip Help
#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


Messages In This Thread
Equip Help - by Josip_Hrnjak - 21.05.2012, 16:03
Re : Equip Help - by Ataraxia - 21.05.2012, 17:02
Re: Equip Help - by Josip_Hrnjak - 21.05.2012, 17:33
Re : Equip Help - by Ataraxia - 22.05.2012, 11:02

Forum Jump:


Users browsing this thread: 1 Guest(s)