Advertisement
Guest User

Weapon Shop V.3.0 By Danyal

a guest
Aug 16th, 2013
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. Credits -         Y_Less
  3.                   ZeeX
  4.                   Danyal
  5.  
  6. ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  7.                             Weapon Shop By Danyal
  8.                         Please keep the credits to me
  9.                             Enjoy WEAPON-SHOP System!
  10. ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  11.  
  12.  
  13. --------------------------------------------------------------------------------
  14.                              I Know You Will Change
  15.                             Please Do Not Remove Credits
  16. --------------------------------------------------------------------------------
  17. */
  18.  
  19. #include <a_samp>
  20. #include <YSI\y_ini>
  21. #include <zcmd>
  22.  
  23. //Defines
  24. #define PATH "WeaponShop/%s.ini"
  25. #define WEAPONSHOP 789
  26. #define COLOR_RED 0xAA3333AA
  27. #define COLOR_GREEN 0x33AA33FF
  28.  
  29. //Player Weapon Info
  30. enum wInfo {
  31.  
  32. // Weapons
  33.     Weapon1,
  34.     Weapon2,
  35.     Weapon3,
  36.     Weapon4,
  37.     Weapon5,
  38.     Weapon6,
  39.     Weapon7,
  40.     Weapon8,
  41.     Weapon9,
  42.     Weapon10,
  43.     Weapon11,
  44.     Weapon12,
  45.  
  46. //Ammo
  47.     Ammo1,
  48.     Ammo2,
  49.     Ammo3,
  50.     Ammo4,
  51.     Ammo5,
  52.     Ammo6,
  53.     Ammo7,
  54.     Ammo8,
  55.     Ammo9,
  56.     Ammo10,
  57.     Ammo11,
  58.     Ammo12,
  59.  
  60. //Skills
  61.     SKILL_PISTOL,
  62.     SKILL_PISTOL_SILENCED,
  63.     SKILL_DESERT_EAGLE,
  64.     SKILL_SHOTGUN,
  65.     SKILL_SAWNOFF_SHOTGUN,
  66.     SKILL_SPAS12_SHOTGUN,
  67.     SKILL_MICRO_UZI,
  68.     SKILL_MP5,
  69.     SKILL_AK47,
  70.     SKILL_M4,
  71.     SKILL_SNIPERRIFLE
  72. }
  73. new WeaponInfo[MAX_PLAYERS][wInfo];
  74.  
  75. public OnFilterScriptInit()
  76. {
  77.         print("\n--------------------------------------");
  78.         print(" WEAPONS-SHOP v3.0 Loaded by Danyal");
  79.         print("--------------------------------------\n");
  80.         return 1;
  81. }
  82.  
  83. public OnFilterScriptExit()
  84. {
  85.         print("\n--------------------------------------");
  86.         print(" WEAPONS-SHOP v3.0 UnLoaded by Danyal");
  87.         print("--------------------------------------\n");
  88.         return 1;
  89. }
  90. public OnPlayerConnect(playerid)
  91. {
  92.  
  93.         if(!fexist(pWeaponSave(playerid)))
  94.         {
  95.                 new INI:file = INI_Open(pWeaponSave(playerid));
  96.                 //  Weapon Create
  97.                 INI_WriteInt(file, "Weapon1", 0);
  98.                 INI_WriteInt(file, "Weapon2", 0);
  99.                 INI_WriteInt(file, "Weapon3", 0);
  100.                 INI_WriteInt(file, "Weapon4", 0);
  101.                 INI_WriteInt(file, "Weapon5", 0);
  102.                 INI_WriteInt(file, "Weapon6", 0);
  103.                 INI_WriteInt(file, "Weapon7", 0);
  104.                 INI_WriteInt(file, "Weapon8", 0);
  105.                 INI_WriteInt(file, "Weapon9", 0);
  106.                 INI_WriteInt(file, "Weapon10", 0);
  107.                 INI_WriteInt(file, "Weapon11", 0);
  108.                 INI_WriteInt(file, "Weapon12", 0);
  109.                 // Ammo Create
  110.                 INI_WriteInt(file, "Ammo1", 0);
  111.                 INI_WriteInt(file, "Ammo2", 0);
  112.                 INI_WriteInt(file, "Ammo3", 0);
  113.                 INI_WriteInt(file, "Ammo4", 0);
  114.                 INI_WriteInt(file, "Ammo5", 0);
  115.                 INI_WriteInt(file, "Ammo6", 0);
  116.                 INI_WriteInt(file, "Ammo7", 0);
  117.                 INI_WriteInt(file, "Ammo8", 0);
  118.                 INI_WriteInt(file, "Ammo9", 0);
  119.                 INI_WriteInt(file, "Ammo10", 0);
  120.                 INI_WriteInt(file, "Ammo11", 0);
  121.                 INI_WriteInt(file, "Ammo12", 0);
  122.                 //Weapon Skill
  123.                 INI_WriteInt(file, "SKILL_PISTOL", 1);
  124.                 INI_WriteInt(file, "SKILL_PISTOL_SILENCED", 1);
  125.                 INI_WriteInt(file, "SKILL_DESERT_EAGLE", 1);
  126.                 INI_WriteInt(file, "SKILL_SHOTGUN", 1);
  127.                 INI_WriteInt(file, "SKILL_SAWNOFF_SHOTGUN", 1);
  128.                 INI_WriteInt(file, "SKILL_SPAS12_SHOTGUN", 1);
  129.                 INI_WriteInt(file, "SKILL_MICRO_UZI", 1);
  130.                 INI_WriteInt(file, "SKILL_MP5", 1);
  131.                 INI_WriteInt(file, "SKILL_AK47", 1);
  132.                 INI_WriteInt(file, "SKILL_M4", 1);
  133.                 INI_WriteInt(file, "SKILL_SNIPERRIFLE", 1);
  134.                 INI_Close(file);
  135.                 INI_ParseFile(pWeaponSave(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  136.         }
  137.         else if(fexist(pWeaponSave(playerid)))
  138.         {
  139.                 INI_ParseFile(pWeaponSave(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  140.         }
  141.         return 1;
  142. }
  143.  
  144. public OnPlayerSpawn(playerid)
  145. {
  146.         SendClientMessage(playerid, -1, "This Server Uses Weapon Shop V3.0 By Danyal");
  147.         SetPlayerSkillLevel(playerid, SKILL_PISTOL, WeaponInfo[playerid][SKILL_PISTOL]);
  148.         SetPlayerSkillLevel(playerid, SKILL_PISTOL_SILENCED, WeaponInfo[playerid][SKILL_PISTOL_SILENCED]);
  149.         SetPlayerSkillLevel(playerid, SKILL_DESERT_EAGLE, WeaponInfo[playerid][SKILL_DESERT_EAGLE]);
  150.         SetPlayerSkillLevel(playerid, SKILL_SHOTGUN, WeaponInfo[playerid][SKILL_SHOTGUN]);
  151.         SetPlayerSkillLevel(playerid, SKILL_SAWNOFF_SHOTGUN, WeaponInfo[playerid][SKILL_SAWNOFF_SHOTGUN]);
  152.         SetPlayerSkillLevel(playerid, SKILL_SPAS12_SHOTGUN, WeaponInfo[playerid][SKILL_SPAS12_SHOTGUN]);
  153.         SetPlayerSkillLevel(playerid, SKILL_MICRO_UZI, WeaponInfo[playerid][SKILL_MICRO_UZI]);
  154.         SetPlayerSkillLevel(playerid, SKILL_MP5, WeaponInfo[playerid][SKILL_MP5]);
  155.         SetPlayerSkillLevel(playerid, SKILL_AK47, WeaponInfo[playerid][SKILL_AK47]);
  156.         SetPlayerSkillLevel(playerid, SKILL_M4, WeaponInfo[playerid][SKILL_M4]);
  157.         SetPlayerSkillLevel(playerid, SKILL_SNIPERRIFLE, WeaponInfo[playerid][SKILL_SNIPERRIFLE]);
  158.         GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon1], WeaponInfo[playerid][Ammo1]);
  159.         GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon2], WeaponInfo[playerid][Ammo2]);
  160.         GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon3], WeaponInfo[playerid][Ammo3]);
  161.         GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon4], WeaponInfo[playerid][Ammo4]);
  162.         GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon5], WeaponInfo[playerid][Ammo5]);
  163.         GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon6], WeaponInfo[playerid][Ammo6]);
  164.         GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon7], WeaponInfo[playerid][Ammo7]);
  165.         GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon8], WeaponInfo[playerid][Ammo8]);
  166.         GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon9], WeaponInfo[playerid][Ammo9]);
  167.         GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon10], WeaponInfo[playerid][Ammo10]);
  168.         GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon11], WeaponInfo[playerid][Ammo11]);
  169.         GivePlayerWeapon(playerid, WeaponInfo[playerid][Weapon12], WeaponInfo[playerid][Ammo12]);
  170.         return 1;
  171. }
  172.  
  173. public OnPlayerDeath(playerid, killerid, reason)
  174. {
  175.     new Weapon = GetPlayerWeapon(killerid);
  176.     switch(Weapon)
  177.     {
  178.         case 22: WeaponInfo[killerid][SKILL_PISTOL]++;
  179.         case 23: WeaponInfo[killerid][SKILL_PISTOL_SILENCED]++;
  180.         case 24: WeaponInfo[killerid][SKILL_DESERT_EAGLE]++;
  181.         case 25: WeaponInfo[killerid][SKILL_SHOTGUN]++;
  182.         case 26: WeaponInfo[killerid][SKILL_SAWNOFF_SHOTGUN]++;
  183.         case 27: WeaponInfo[killerid][SKILL_SPAS12_SHOTGUN]++;
  184.         case 28: WeaponInfo[killerid][SKILL_MICRO_UZI]++;
  185.         case 29: WeaponInfo[killerid][SKILL_MP5]++;
  186.         case 30: WeaponInfo[killerid][SKILL_AK47]++;
  187.         case 31: WeaponInfo[killerid][SKILL_M4]++;
  188.         case 34: WeaponInfo[killerid][SKILL_SNIPERRIFLE]++;
  189.     }
  190.     return 1;
  191. }
  192.  
  193. public OnPlayerDisconnect(playerid, reason)
  194. {
  195.     GetPlayerWeaponData(playerid, 1, WeaponInfo[playerid][Weapon1], WeaponInfo[playerid][Ammo1]);
  196.     GetPlayerWeaponData(playerid, 2, WeaponInfo[playerid][Weapon2], WeaponInfo[playerid][Ammo2]);
  197.     GetPlayerWeaponData(playerid, 3, WeaponInfo[playerid][Weapon3], WeaponInfo[playerid][Ammo3]);
  198.     GetPlayerWeaponData(playerid, 4, WeaponInfo[playerid][Weapon4], WeaponInfo[playerid][Ammo4]);
  199.     GetPlayerWeaponData(playerid, 5, WeaponInfo[playerid][Weapon5], WeaponInfo[playerid][Ammo5]);
  200.     GetPlayerWeaponData(playerid, 6, WeaponInfo[playerid][Weapon6], WeaponInfo[playerid][Ammo6]);
  201.     GetPlayerWeaponData(playerid, 7, WeaponInfo[playerid][Weapon7], WeaponInfo[playerid][Ammo7]);
  202.     GetPlayerWeaponData(playerid, 8, WeaponInfo[playerid][Weapon8], WeaponInfo[playerid][Ammo8]);
  203.     GetPlayerWeaponData(playerid, 9, WeaponInfo[playerid][Weapon9], WeaponInfo[playerid][Ammo9]);
  204.     GetPlayerWeaponData(playerid, 10, WeaponInfo[playerid][Weapon10], WeaponInfo[playerid][Ammo10]);
  205.     GetPlayerWeaponData(playerid, 11, WeaponInfo[playerid][Weapon11], WeaponInfo[playerid][Ammo11]);
  206.     GetPlayerWeaponData(playerid, 12, WeaponInfo[playerid][Weapon12], WeaponInfo[playerid][Ammo12]);
  207.  
  208.     if(fexist(pWeaponSave(playerid)))
  209.     {
  210.                 new INI:file = INI_Open(pWeaponSave(playerid));
  211.                 //      Weapon Save
  212.                 INI_WriteInt(file, "Weapon1", WeaponInfo[playerid][Weapon1]);
  213.                 INI_WriteInt(file, "Weapon2", WeaponInfo[playerid][Weapon2]);
  214.                 INI_WriteInt(file, "Weapon3", WeaponInfo[playerid][Weapon3]);
  215.                 INI_WriteInt(file, "Weapon4", WeaponInfo[playerid][Weapon4]);
  216.                 INI_WriteInt(file, "Weapon5", WeaponInfo[playerid][Weapon5]);
  217.                 INI_WriteInt(file, "Weapon6", WeaponInfo[playerid][Weapon6]);
  218.                 INI_WriteInt(file, "Weapon7", WeaponInfo[playerid][Weapon7]);
  219.                 INI_WriteInt(file, "Weapon8", WeaponInfo[playerid][Weapon8]);
  220.                 INI_WriteInt(file, "Weapon9", WeaponInfo[playerid][Weapon9]);
  221.                 INI_WriteInt(file, "Weapon10", WeaponInfo[playerid][Weapon10]);
  222.                 INI_WriteInt(file, "Weapon11", WeaponInfo[playerid][Weapon11]);
  223.                 INI_WriteInt(file, "Weapon12", WeaponInfo[playerid][Weapon12]);
  224.                 //      Ammo Save
  225.                 INI_WriteInt(file, "Ammo1", WeaponInfo[playerid][Ammo1]);
  226.                 INI_WriteInt(file, "Ammo2", WeaponInfo[playerid][Ammo2]);
  227.                 INI_WriteInt(file, "Ammo3", WeaponInfo[playerid][Ammo3]);
  228.                 INI_WriteInt(file, "Ammo4", WeaponInfo[playerid][Ammo4]);
  229.                 INI_WriteInt(file, "Ammo5", WeaponInfo[playerid][Ammo5]);
  230.                 INI_WriteInt(file, "Ammo6", WeaponInfo[playerid][Ammo6]);
  231.                 INI_WriteInt(file, "Ammo7", WeaponInfo[playerid][Ammo7]);
  232.                 INI_WriteInt(file, "Ammo8", WeaponInfo[playerid][Ammo8]);
  233.                 INI_WriteInt(file, "Ammo9", WeaponInfo[playerid][Ammo9]);
  234.                 INI_WriteInt(file, "Ammo10", WeaponInfo[playerid][Ammo10]);
  235.                 INI_WriteInt(file, "Ammo11", WeaponInfo[playerid][Ammo11]);
  236.                 INI_WriteInt(file, "Ammo12", WeaponInfo[playerid][Ammo12]);
  237.                 //      Skill Save
  238.                 INI_WriteInt(file, "SKILL_PISTOL", WeaponInfo[playerid][SKILL_PISTOL]);
  239.                 INI_WriteInt(file, "SKILL_PISTOL_SILENCED", WeaponInfo[playerid][SKILL_PISTOL_SILENCED]);
  240.                 INI_WriteInt(file, "SKILL_DESERT_EAGLE", WeaponInfo[playerid][SKILL_DESERT_EAGLE]);
  241.                 INI_WriteInt(file, "SKILL_SHOTGUN", WeaponInfo[playerid][SKILL_SHOTGUN]);
  242.                 INI_WriteInt(file, "SKILL_SAWNOFF_SHOTGUN", WeaponInfo[playerid][SKILL_SAWNOFF_SHOTGUN]);
  243.                 INI_WriteInt(file, "SKILL_SPAS12_SHOTGUN", WeaponInfo[playerid][SKILL_SPAS12_SHOTGUN]);
  244.                 INI_WriteInt(file, "SKILL_MICRO_UZI", WeaponInfo[playerid][SKILL_MICRO_UZI]);
  245.                 INI_WriteInt(file, "SKILL_MP5", WeaponInfo[playerid][SKILL_MP5]);
  246.                 INI_WriteInt(file, "SKILL_AK47", WeaponInfo[playerid][SKILL_AK47]);
  247.                 INI_WriteInt(file, "SKILL_M4", WeaponInfo[playerid][SKILL_M4]);
  248.                 INI_WriteInt(file, "SKILL_SNIPERRIFLE", WeaponInfo[playerid][SKILL_SNIPERRIFLE]);
  249.  
  250.                 INI_Close(file);
  251.     }
  252.     return 1;
  253. }
  254.  
  255. CMD:shopweaps(playerid, params[])
  256. {
  257.     if(IsPlayerConnected(playerid))
  258.     {
  259.         ShowPlayerDialog(playerid, WEAPONSHOP, DIALOG_STYLE_LIST, "AmmuNation", "{9FE4AA}Pistols\n{F9B857}Sub-Machine Gun\n{FAFA52}Shotguns\n{C77D87}Armours\n{B8FF02}SMG\n{F300FF}Assault", "Select", "Cancel");
  260.     }
  261.     return 1;
  262. }
  263.  
  264. CMD:showskills(playerid, params[])
  265. {
  266.     if(IsPlayerConnected(playerid))
  267.     {
  268.         new showskillz[476];
  269.         new pName[MAX_PLAYER_NAME];
  270.         GetPlayerName(playerid, pName, sizeof(pName));
  271.         format (showskillz, sizeof(showskillz), "{FFFFFF}Player {FF0000}%s{FFFFFF} Stats \n",pName );
  272.         format (showskillz, sizeof(showskillz), "{FFFFFF}Pistol:{FF0000}%i , {FFFFFF}Silenced Pistol:{FF0000}%i , {FFFFFF}Desert:{FF0000}%i \n", WeaponInfo[playerid][SKILL_PISTOL] , WeaponInfo[playerid][SKILL_PISTOL_SILENCED], WeaponInfo[playerid][SKILL_DESERT_EAGLE]);
  273.         format (showskillz, sizeof(showskillz), "{FFFFFF}Shotgun:{FF0000}%i , {FFFFFF}SawnOff ShotGun:{FF0000}%i , {FFFFFF}Spas12 Shotgun:{FF0000}%i \n", WeaponInfo[playerid][SKILL_SHOTGUN], WeaponInfo[playerid][SKILL_SAWNOFF_SHOTGUN], WeaponInfo[playerid][SKILL_SPAS12_SHOTGUN]);
  274.         format (showskillz, sizeof(showskillz), "{FFFFFF}Uzi:{FF0000}%i , {FFFFFF}MP5:{FF0000}%i , {FFFFFF}AK47:{FF0000}%i \n", WeaponInfo[playerid][SKILL_MICRO_UZI], WeaponInfo[playerid][SKILL_MP5], WeaponInfo[playerid][SKILL_AK47]);
  275.         format (showskillz, sizeof(showskillz), "{FFFFFF}M4:{FF0000}%i , {FFFFFF}Sniper Rifle:{FF0000}%i.",WeaponInfo[playerid][SKILL_M4], WeaponInfo[playerid][SKILL_SNIPERRIFLE]);
  276.         SendClientMessage(playerid, -1, showskillz);
  277.     }
  278.     return 1;
  279. }
  280.  
  281. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  282. {
  283.         switch(dialogid)
  284.         {
  285.                 case WEAPONSHOP:
  286.                 {
  287.                         if(response)
  288.                         {
  289.                                 switch(listitem)
  290.                                 {
  291.                                         case 0: ShowPlayerDialog(playerid, WEAPONSHOP+1, DIALOG_STYLE_LIST, "Pistols", "9mm\t\t\t$200\nSilenced 9mm\t\t$600\nDesert Eagle\t\t$1200", "Select", "Cancel");
  292.                                         case 1: ShowPlayerDialog(playerid, WEAPONSHOP+2, DIALOG_STYLE_LIST, "Sub-Machine Gun", "Tec9\t\t\t$300\nMicro SMG\t\t$500", "Select", "Cancel");
  293.                                         case 2: ShowPlayerDialog(playerid, WEAPONSHOP+3, DIALOG_STYLE_LIST, "Shotguns", "Shotgun\t\t\t$600\nSawnoff Shotgun\t\t$800\nCombat Shotgun\t\t$1000", "Select", "Cancel");
  294.                                         case 3: ShowPlayerDialog(playerid, WEAPONSHOP+4, DIALOG_STYLE_LIST, "Armours", "Armour\t\t\t$200", "Select", "Cancel");
  295.                                         case 4: ShowPlayerDialog(playerid, WEAPONSHOP+5, DIALOG_STYLE_LIST, "SMG", "MP5\t\t\t$2000", "Select", "Cancel");
  296.                                         case 5: ShowPlayerDialog(playerid, WEAPONSHOP+6, DIALOG_STYLE_LIST, "Assault", "AK47\t\t$3500\nM4\t\t$4500", "Select", "Cancel");
  297.                                 }
  298.                                 return 1;
  299.                         }
  300.                         return 1;
  301.                 }
  302.  
  303.                 case WEAPONSHOP+1:
  304.                 {
  305.                         if(response)
  306.                         {
  307.                                 switch(listitem)
  308.                                 {
  309.                                         case 0:
  310.                                         {
  311.                                                 if(GetPlayerMoney(playerid) <200)
  312.                                                 return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!");
  313.                                                 GivePlayerMoney(playerid, -200);
  314.                                                 GivePlayerWeapon(playerid,22,30);
  315.                                                 SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a 9mm! ($200)");
  316.                                                 ShowPlayerDialog(playerid, WEAPONSHOP, DIALOG_STYLE_LIST, "AmmuNation", "{F9B857}Pistols\n{F9B857}Sub-Machine Gun\n{FAFA52}Shotguns\n{C77D87}Armours\n{B8FF02}SMG\n{F300FF}Assault", "Select", "Cancel");
  317.                                         }
  318.  
  319.                                         case 1:
  320.                                         {
  321.                                                 if(GetPlayerMoney(playerid) <600)
  322.                                                 return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!");
  323.                                                 GivePlayerMoney(playerid, -600);
  324.                                                 GivePlayerWeapon(playerid,23,30);
  325.                                                 SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a Silenced 9mm! ($600)");
  326.                                                 ShowPlayerDialog(playerid, WEAPONSHOP, DIALOG_STYLE_LIST, "AmmuNation", "{F9B857}Pistols\n{F9B857}Sub-Machine Gun\n{FAFA52}Shotguns\n{C77D87}Armours\n{B8FF02}SMG\n{F300FF}Assault", "Select", "Cancel");
  327.                                         }
  328.  
  329.                                         case 2:
  330.                                         {
  331.                                                 if(GetPlayerMoney(playerid) <1200)
  332.                                                 return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!");
  333.                                                 GivePlayerMoney(playerid, -1200);
  334.                                                 GivePlayerWeapon(playerid,24,30);
  335.                                                 SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a Desert Eagle! ($1200)");
  336.                                                 ShowPlayerDialog(playerid, WEAPONSHOP, DIALOG_STYLE_LIST, "AmmuNation", "{F9B857}Pistols\n{F9B857}Sub-Machine Gun\n{FAFA52}Shotguns\n{C77D87}Armours\n{B8FF02}SMG\n{F300FF}Assault", "Select", "Cancel");
  337.                                         }
  338.                                 }
  339.                                 return 1;
  340.                         }
  341.                         return 1;
  342.                 }
  343.  
  344.                 case WEAPONSHOP+2:
  345.                 {
  346.                         if(response)
  347.                         {
  348.                                 switch(listitem)
  349.                                 {
  350.                                         case 0:
  351.                                         {
  352.                                                 if(GetPlayerMoney(playerid) <300)
  353.                                                 return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!");
  354.                                                 GivePlayerMoney(playerid, -300);
  355.                                                 GivePlayerWeapon(playerid,32,30);
  356.                                                 SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a Tec9! ($300)");
  357.                                                 ShowPlayerDialog(playerid, WEAPONSHOP, DIALOG_STYLE_LIST, "AmmuNation", "{F9B857}Pistols\n{F9B857}Sub-Machine Gun\n{FAFA52}Shotguns\n{C77D87}Armours\n{B8FF02}SMG\n{F300FF}Assault", "Select", "Cancel");
  358.                                         }
  359.  
  360.                                         case 1:
  361.                                         {
  362.                                                 if(GetPlayerMoney(playerid) <500)
  363.                                                 return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!");
  364.                                                 GivePlayerMoney(playerid, -500);
  365.                                                 GivePlayerWeapon(playerid,28,30);
  366.                                                 SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a Micro SMG! ($500)");
  367.                                                 ShowPlayerDialog(playerid, WEAPONSHOP, DIALOG_STYLE_LIST, "AmmuNation", "{F9B857}Pistols\n{F9B857}Sub-Machine Gun\n{FAFA52}Shotguns\n{C77D87}Armours\n{B8FF02}SMG\n{F300FF}Assault", "Select", "Cancel");
  368.                                         }
  369.                                 }
  370.                                 return 1;
  371.                         }
  372.                         return 1;
  373.                 }
  374.  
  375.                 case WEAPONSHOP+3:
  376.                 {
  377.                         if(response)
  378.                         {
  379.                                 switch(listitem)
  380.                                 {
  381.                                         case 0:
  382.                                         {
  383.                                                 if(GetPlayerMoney(playerid) <600)
  384.                                                 return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!");
  385.                                                 GivePlayerMoney(playerid, -600);
  386.                                                 GivePlayerWeapon(playerid,25,15);
  387.                                                 SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a Shotgun! ($600)");
  388.                                                 ShowPlayerDialog(playerid, WEAPONSHOP, DIALOG_STYLE_LIST, "AmmuNation", "{F9B857}Pistols\n{F9B857}Sub-Machine Gun\n{FAFA52}Shotguns\n{C77D87}Armours\n{B8FF02}SMG\n{F300FF}Assault", "Select", "Cancel");
  389.                                         }
  390.  
  391.                                         case 1:
  392.                                         {
  393.                                                 if(GetPlayerMoney(playerid) <800)
  394.                                                 return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!");
  395.                                                 GivePlayerMoney(playerid, -800);
  396.                                                 GivePlayerWeapon(playerid,26,15);
  397.                                                 SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a Sawnoff Shotgun (800$)");
  398.                                                 ShowPlayerDialog(playerid, WEAPONSHOP, DIALOG_STYLE_LIST, "AmmuNation", "{F9B857}Pistols\n{F9B857}Sub-Machine Gun\n{FAFA52}Shotguns\n{C77D87}Armours\n{B8FF02}SMG\n{F300FF}Assault", "Select", "Cancel");
  399.                                         }
  400.  
  401.                                         case 2:
  402.                                         {
  403.                                                 if(GetPlayerMoney(playerid) <1000)
  404.                                                 return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!");
  405.                                                 GivePlayerMoney(playerid, -1000);
  406.                                                 GivePlayerWeapon(playerid,27,15);
  407.                                                 SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a Combat Shotgun (1000$)");
  408.                                                 ShowPlayerDialog(playerid, WEAPONSHOP, DIALOG_STYLE_LIST, "AmmuNation", "{F9B857}Pistols\n{F9B857}Sub-Machine Gun\n{FAFA52}Shotguns\n{C77D87}Armours\n{B8FF02}SMG\n{F300FF}Assault", "Select", "Cancel");
  409.                                         }
  410.                                 }
  411.                                 return 1;
  412.                         }
  413.                         return 1;
  414.                 }
  415.  
  416.                 case WEAPONSHOP+4:
  417.                 {
  418.                         if(response)
  419.                         {
  420.                                 switch(listitem)
  421.                                 {
  422.                                         case 0:
  423.                                         {
  424.                                                 if(GetPlayerMoney(playerid) <200)
  425.                                                 return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!");
  426.                                                 GivePlayerMoney(playerid, -200);
  427.                                                 SetPlayerArmour(playerid, 100);
  428.                                                 SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a Armour! ($200)");
  429.                                                 ShowPlayerDialog(playerid, WEAPONSHOP, DIALOG_STYLE_LIST, "AmmuNation", "{F9B857}Pistols\n{F9B857}Sub-Machine Gun\n{FAFA52}Shotguns\n{C77D87}Armours\n{B8FF02}SMG\n{F300FF}Assault", "Select", "Cancel");
  430.                                         }
  431.                                 }
  432.                                 return 1;
  433.                         }
  434.                         return 1;
  435.                 }
  436.  
  437.                 case WEAPONSHOP+5:
  438.                 {
  439.                         if(response)
  440.                         {
  441.                                 switch(listitem)
  442.                                 {
  443.                                         case 0:
  444.                                         {
  445.                                                 if(GetPlayerMoney(playerid) <2000)
  446.                                                 return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!");
  447.                                                 GivePlayerMoney(playerid, -2000);
  448.                                                 GivePlayerWeapon(playerid,29,30);
  449.                                                 SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a MP5 (2000$)");
  450.                                                 ShowPlayerDialog(playerid, WEAPONSHOP, DIALOG_STYLE_LIST, "AmmuNation", "{F9B857}Pistols\n{F9B857}Sub-Machine Gun\n{FAFA52}Shotguns\n{C77D87}Armours\n{B8FF02}SMG\n{F300FF}Assault", "Select", "Cancel");
  451.                                         }
  452.                                 }
  453.                                 return 1;
  454.                         }
  455.                         return 1;
  456.                 }
  457.  
  458.                 case WEAPONSHOP+6:
  459.                 {
  460.                         if(response)
  461.                         {
  462.                                 switch(listitem)
  463.                                 {
  464.                                         case 0:
  465.                                         {
  466.                                                 if(GetPlayerMoney(playerid) <3500)
  467.                                                 return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!");
  468.                                                 GivePlayerMoney(playerid, -3500);
  469.                                                 GivePlayerWeapon(playerid,30,120);
  470.                                                 SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a AK47 (3500$)");
  471.                                                 ShowPlayerDialog(playerid, WEAPONSHOP, DIALOG_STYLE_LIST, "AmmuNation", "{F9B857}Pistols\n{F9B857}Sub-Machine Gun\n{FAFA52}Shotguns\n{C77D87}Armours\n{B8FF02}SMG\n{F300FF}Assault", "Select", "Cancel");
  472.                                         }
  473.  
  474.                                         case 1:
  475.                                         {
  476.                                                 if(GetPlayerMoney(playerid) <4500)
  477.                                                 return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to purchase this item!");
  478.                                                 GivePlayerMoney(playerid, -4500);
  479.                                                 GivePlayerWeapon(playerid,31,120);
  480.                                                 SendClientMessage(playerid, COLOR_GREEN, "Thank you for purchasing a M4 (4500$)");
  481.                                                 ShowPlayerDialog(playerid, WEAPONSHOP, DIALOG_STYLE_LIST, "AmmuNation", "{F9B857}Pistols\n{F9B857}Sub-Machine Gun\n{FAFA52}Shotguns\n{C77D87}Armours\n{B8FF02}SMG\n{F300FF}Assault", "Select", "Cancel");
  482.                                         }
  483.                                 }
  484.                                 return 1;
  485.                         }
  486.                         return 1;
  487.                 }
  488.         }
  489.         return 1;
  490. }
  491.  
  492. //Loaduser Public
  493. forward LoadUser_data(playerid, name[], value[]);
  494. public LoadUser_data(playerid, name[], value[])
  495. {
  496.         // Load Weapons
  497.         INI_Int("Weapon1", WeaponInfo[playerid][Weapon1]);
  498.         INI_Int("Weapon2", WeaponInfo[playerid][Weapon2]);
  499.         INI_Int("Weapon3", WeaponInfo[playerid][Weapon3]);
  500.         INI_Int("Weapon4", WeaponInfo[playerid][Weapon4]);
  501.         INI_Int("Weapon5", WeaponInfo[playerid][Weapon5]);
  502.         INI_Int("Weapon6", WeaponInfo[playerid][Weapon6]);
  503.         INI_Int("Weapon7", WeaponInfo[playerid][Weapon7]);
  504.         INI_Int("Weapon8", WeaponInfo[playerid][Weapon8]);
  505.         INI_Int("Weapon9", WeaponInfo[playerid][Weapon9]);
  506.         INI_Int("Weapon10", WeaponInfo[playerid][Weapon10]);
  507.         INI_Int("Weapon11", WeaponInfo[playerid][Weapon11]);
  508.         INI_Int("Weapon12", WeaponInfo[playerid][Weapon12]);
  509.  
  510.         // Load Ammo
  511.         INI_Int("Ammo1", WeaponInfo[playerid][Ammo1]);
  512.         INI_Int("Ammo2", WeaponInfo[playerid][Ammo2]);
  513.         INI_Int("Ammo3", WeaponInfo[playerid][Ammo3]);
  514.         INI_Int("Ammo4", WeaponInfo[playerid][Ammo4]);
  515.         INI_Int("Ammo5", WeaponInfo[playerid][Ammo5]);
  516.         INI_Int("Ammo6", WeaponInfo[playerid][Ammo6]);
  517.         INI_Int("Ammo7", WeaponInfo[playerid][Ammo7]);
  518.         INI_Int("Ammo8", WeaponInfo[playerid][Ammo8]);
  519.         INI_Int("Ammo9", WeaponInfo[playerid][Ammo9]);
  520.         INI_Int("Ammo10", WeaponInfo[playerid][Ammo10]);
  521.         INI_Int("Ammo11", WeaponInfo[playerid][Ammo11]);
  522.         INI_Int("Ammo12", WeaponInfo[playerid][Ammo12]);
  523.  
  524.         // Load Skills
  525.         INI_Int("SKILL_PISTOL", WeaponInfo[playerid][SKILL_PISTOL]);
  526.         INI_Int("SKILL_PISTOL_SILENCED", WeaponInfo[playerid][SKILL_PISTOL_SILENCED]);
  527.         INI_Int("SKILL_DESERT_EAGLE", WeaponInfo[playerid][SKILL_DESERT_EAGLE]);
  528.         INI_Int("SKILL_SHOTGUN", WeaponInfo[playerid][SKILL_SHOTGUN]);
  529.         INI_Int("SKILL_SAWNOFF_SHOTGUN", WeaponInfo[playerid][SKILL_SAWNOFF_SHOTGUN]);
  530.         INI_Int("SKILL_SPAS12_SHOTGUN", WeaponInfo[playerid][SKILL_SPAS12_SHOTGUN]);
  531.         INI_Int("SKILL_MICRO_UZI", WeaponInfo[playerid][SKILL_MICRO_UZI]);
  532.         INI_Int("SKILL_MP5", WeaponInfo[playerid][SKILL_MP5]);
  533.         INI_Int("SKILL_AK47", WeaponInfo[playerid][SKILL_AK47]);
  534.         INI_Int("SKILL_M4", WeaponInfo[playerid][SKILL_M4]);
  535.         INI_Int("SKILL_SNIPERRIFLE", WeaponInfo[playerid][SKILL_SNIPERRIFLE]);
  536.         return 1;
  537. }
  538.  
  539. //Stocks
  540. stock pWeaponSave(playerid)
  541. {
  542.     new string[50];
  543.     format(string, sizeof(string), PATH, GetName(playerid));
  544.     return string;
  545. }
  546.  
  547. stock GetName(playerid)
  548. {
  549.     new name[24];
  550.     GetPlayerName(playerid, name, sizeof(name));
  551.     return name;
  552. }
  553.  
  554. //------------------------------------------------------------------------------
  555. //============================I Know You Will Change============================
  556. //=========================Please Do Not Remove Credits=========================
  557. //------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement