24.07.2012, 07:36
How to add samo more weapon types to sell in ammu nation
#include <a_samp>
#include <zcmd>
#define red 0xFF0000AA
#define DIALOG_WEAPON 1
CMD:buygun(playerid, params[])
{
ShowPlayerDialog(playerid, DIALOG_WEAPON, DIALOG_STYLE_LIST, "Weapon Menu", "M4\nAK47\nSniper Rifle\nCombat Shotgun\nSawnoff Shotgun", "Buygun", "Cancel");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_WEAPON)
{
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid) <300)
return SendClientMessage(playerid, red, "[SYSTEM]:You dont have enough money to buy this M4 for $300!");
GivePlayerMoney(playerid, -300);
GivePlayerWeapon(playerid, 31, 250);
SendClientMessage(playerid, red, "You have purchase this weapon!");
}
case 1:
{
if(GetPlayerMoney(playerid) <300)
return SendClientMessage(playerid, red, "[SYSTEM]:You dont have enough money to buy this AK47 for $300!");
GivePlayerMoney(playerid, -300);
GivePlayerWeapon(playerid, 30, 250);
SendClientMessage(playerid, red, "You have purchase this weapon!");
}
case 2:
{
if(GetPlayerMoney(playerid) <250)
return SendClientMessage(playerid, red, "[SYSTEM]:You dont have enough money to buy this Sniper Rifle for $250!");
GivePlayerMoney(playerid, -250);
GivePlayerWeapon(playerid, 34, 50);
SendClientMessage(playerid, red, "You have purchase this weapon!");
}
case 3:
{
if(GetPlayerMoney(playerid) <270)
return SendClientMessage(playerid, red, "[SYSTEM]:You dont have enough money to buy this Combat Shotgun for $270!");
GivePlayerMoney(playerid, -270);
GivePlayerWeapon(playerid, 27, 100);
SendClientMessage(playerid, red, "You have purchase this weapon!");
}
case 4:
{
if(GetPlayerMoney(playerid) <290)
return SendClientMessage(playerid, red, "[SYSTEM]:You dont have enough money to buy this Sawnoff Shotgun for $290!");
GivePlayerMoney(playerid, -290);
GivePlayerWeapon(playerid, 26, 150);
SendClientMessage(playerid, red, "You have purchase this weapon!");
}
}
}
return 1;
}
pawn Код:
|