07.03.2012, 17:55
Command 1.
Command 2.
DIALOG
pawn Код:
CMD:armour(playerid, params[])
{
if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
if(IsPlayerInRangeOfPoint(playerid, 5,962.6015, 2101.4980, 1011.0267) && Faction[playerid] == 3 || IsPlayerInRangeOfPoint(playerid, 5, 321.1703,308.9879,999.1484) && Faction[playerid] == 1)
{
ShowPlayerDialog(playerid, DIALOG_ARMOUR, DIALOG_STYLE_LIST, "Armour Selection(Also provides health.)", "Standard Armour\nKevlar Vest(Increased Protection)\nHealth\n", "Select", "Cancel");
}
return 1;
}
pawn Код:
CMD:removevest(playerid, params[])
{
if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
if(!IsPlayerAttachedObjectSlotUsed(playerid, 0))return SendClientMessage(playerid, COLOUR_GREY, "You do not have a Kevlar Vest attached.");
RemovePlayerAttachedObject(playerid, 0);
SetPlayerArmour(playerid, 0);
SendClientMessage(playerid, COLOUR_BLUE, "Kevlar Vest removed.");
return 1;
}
pawn Код:
else if(dialogid == DIALOG_ARMOUR)
{
if(response == 0)
{
return 1;
}
if(listitem == 0)
{
SetPlayerArmour(playerid, 100.0);
SendClientMessage(playerid, COLOUR_BLUE, "Standard Armour Retrieved.");
}
if(listitem == 1)
{
SetPlayerAttachedObject(playerid,0,19142,1,0.10,0.03,0.00,-1.0,-3.0,2.0,0.93,1.23,1.18);
SetPlayerArmour(playerid, 150.0);
SendClientMessage(playerid, COLOUR_BLUE, "Kevlar Vest Retrieved, Armour Protection has increased.");
}
if(listitem == 2)
{
SetPlayerHealth(playerid, 100.0);
SendClientMessage(playerid, COLOUR_BLUE, "Health Restored.");
}
}