11.02.2018, 15:05
Код:
stock SellWeapon(playerid, points, weapon, ammo) { new ppoints = GetPlayerPoints(playerid); if(ppoints>=points) { new string[80], weaponname[32]; GivePlayerPoints(playerid, -points); GetPlayerPoints(playerid); GivePlayerWeapon(playerid, weapon,ammo); GetWeaponName(weapon, weaponname, sizeof(weaponname)); format(string, sizeof(string), "{c3c3c3}* You have bought %s with %i ammo for %i points", weaponname, ammo, points); return SendClientMessage(playerid, -1, string); } else { SendClientMessage(playerid, -1,"{c3c3c3}* You don't have enough points to buy this item !"); ShowPlayerDialog(playerid, 8, DIALOG_STYLE_TABLIST_HEADERS, "Market", "Weapon \tPrice \tAmmo \tSlots\n\ Desert Eagle\t{4286f4}15 Points\t100 \tInfinite\n\ Shotgun\t{4286f4}10 Points\t40\tInfinite\n\ Spas\t{4286f4}40 Points\t100\tInfinite\n\ M4\t{4286f4}10 Points\t90\tInfinite\n\ Sniper\t{4286f4}30 Points\t30\tInfinite\n\ Full Health\t{4286f4}150 Points\t-\tInfinite", "Buy", "Leave"); return 1; } }