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.