Advertisement
Guest User

Easy Weapons Update

a guest
Aug 30th, 2012
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 8.67 KB | None | 0 0
  1. //============================================================================//
  2. //                             Easy Weapons                                   //
  3. //                        Scripted By [xB] Lordz                              //
  4. //                            Edited by Sean                                  //
  5. //============================================================================//
  6.  
  7. //============Include===========//
  8. #include <a_samp>
  9. #include <zcmd>
  10.  
  11. //============Define============//
  12. #define COLOR_GREEN 0x008000FF
  13. #define COLOR_RED 0xFF0000FF
  14.  
  15. #define DIALOG_EWEAPONS 1
  16. #define DIALOG_EAMMO 2
  17.  
  18. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  19. {
  20.     if(dialogid == DIALOG_EWEAPONS)
  21.     {
  22.         if(!response)
  23.         SendClientMessage(playerid, COLOR_RED, "You have cancelled the Easy Weapons menu!");
  24.     }
  25.     if(dialogid == DIALOG_EWEAPONS)
  26.     {
  27.         if(response)
  28.         {
  29.             if(listitem == 0) //AK-47//
  30.             {
  31.                 if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You don't have enough money to buy this weapon!");
  32.                 GivePlayerWeapon(playerid, 30, 200);
  33.                 GivePlayerMoney(playerid, -1000);
  34.                 SendClientMessage(playerid, COLOR_GREEN, "You have purchased: AK-47 For $1,000!");
  35.             }
  36.             if(listitem == 1) //M4//
  37.             {
  38.                 if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You don't have enough money to buy this weapon!");
  39.                 GivePlayerWeapon(playerid, 31, 200);
  40.                 GivePlayerMoney(playerid, -1000);
  41.                 SendClientMessage(playerid, 0x33CCFFAA, "You have purchased: M4 For $1,000!");
  42.             }
  43.             if(listitem == 2) //Country Rifle//
  44.             {
  45.                 if(GetPlayerMoney(playerid) < 1200) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You don't have enough money to buy this weapon!");
  46.                 GivePlayerWeapon(playerid, 33, 75);
  47.                 GivePlayerMoney(playerid, -1200);
  48.                 SendClientMessage(playerid, 0x33CCFFAA, "You have purchased: Country-Rifle For $1,200!");
  49.             }
  50.             if(listitem == 3) //Sniper Rifle//
  51.             {
  52.                 if(GetPlayerMoney(playerid) < 1800) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You don't have enough money to buy this weapon!");
  53.                 GivePlayerWeapon(playerid, 34, 10);
  54.                 GivePlayerMoney(playerid, -1800);
  55.                 SendClientMessage(playerid, 0x33CCFFAA, "You have purchased: Sniper-Rifle For $1,800!");
  56.             }
  57.             if(listitem == 4) //MP5//
  58.             {
  59.                 if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You don't have enough money to buy this weapon!");
  60.                 GivePlayerWeapon(playerid, 29, 500);
  61.                 GivePlayerMoney(playerid, -500);
  62.                 SendClientMessage(playerid, 0x33CCFFAA, "You have purchased: MP5 For $500!");
  63.             }
  64.             if(listitem == 5) //Tec 9//
  65.             {
  66.                 if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You don't have enough money to buy this weapon!");
  67.                 GivePlayerWeapon(playerid, 32, 200);
  68.                 GivePlayerMoney(playerid, -500);
  69.                 SendClientMessage(playerid, 0x33CCFFAA, "You have purchased: TEC-9 For $500!");
  70.             }
  71.             if(listitem == 6) //UZI//
  72.             {
  73.                 if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You don't have enough money to buy this weapon!");
  74.                 GivePlayerWeapon(playerid, 28, 200);
  75.                 GivePlayerMoney(playerid, -500);
  76.                 SendClientMessage(playerid, 0x33CCFFAA, "You have purchased: Uzi For $500!");
  77.             }
  78.             if(listitem == 7) //Pistol//
  79.             {
  80.                 if(GetPlayerMoney(playerid) < 200) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You don't have enough money to buy this weapon!");
  81.                 GivePlayerWeapon(playerid, 22, 200);
  82.                 GivePlayerMoney(playerid, -200);
  83.                 SendClientMessage(playerid, 0x33CCFFAA, "You have purchased: Pistol For $200!");
  84.             }
  85.             if(listitem == 8) //Silenced Pistol//
  86.             {
  87.                 if(GetPlayerMoney(playerid) < 200) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You don't have enough money to buy this weapon!");
  88.                 GivePlayerWeapon(playerid, 23, 200);
  89.                 GivePlayerMoney(playerid, -200);
  90.                 SendClientMessage(playerid, 0x33CCFFAA, "You have purchased: Silenced-Pistol For $200!");
  91.             }
  92.             if(listitem == 9) //Desert Eagle//
  93.             {
  94.                 if(GetPlayerMoney(playerid) < 250) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You don't have enough money to buy this weapon!");
  95.                 GivePlayerWeapon(playerid, 24, 100);
  96.                 GivePlayerMoney(playerid, -250);
  97.                 SendClientMessage(playerid, 0x33CCFFAA, "You have purchased: Desert-Eagle For $250!");
  98.             }
  99.             if(listitem == 10) //Knife//
  100.             {
  101.                 if(GetPlayerMoney(playerid) < 50) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You don't have enough money to buy this weapon!");
  102.                 GivePlayerWeapon(playerid, 4, 100);
  103.                 GivePlayerMoney(playerid, -50);
  104.                 SendClientMessage(playerid, 0x33CCFFAA, "You have purchased: Knife For $50!");
  105.             }
  106.             if(listitem == 11) //Katana//
  107.             {
  108.                 if(GetPlayerMoney(playerid) < 100) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You don't have enough money to buy this weapon!");
  109.                 GivePlayerWeapon(playerid, 8, 100);
  110.                 GivePlayerMoney(playerid, -100);
  111.                 SendClientMessage(playerid, 0x33CCFFAA, "You have purchased: Katana For $100!");
  112.             }
  113.             if(listitem == 12) //Shotgun//
  114.             {
  115.                 if(GetPlayerMoney(playerid) < 800) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You don't have enough money to buy this weapon!");
  116.                 GivePlayerWeapon(playerid, 25, 100);
  117.                 GivePlayerMoney(playerid, -800);
  118.                 SendClientMessage(playerid, 0x33CCFFAA, "You have purchased: Shotgun For $800!");
  119.             }
  120.             if(listitem == 13) //Combat Shotgun//
  121.             {
  122.                 if(GetPlayerMoney(playerid) < 800) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You don't have enough money to buy this weapon!");
  123.                 GivePlayerWeapon(playerid, 27, 50);
  124.                 GivePlayerMoney(playerid, -800);
  125.                 SendClientMessage(playerid, 0x33CCFFAA, "You have purchased: Combat-ShotGun For $800!");
  126.             }
  127.             if(listitem == 14) //Sawnoff Shotgun//
  128.             {
  129.                 if(GetPlayerMoney(playerid) < 800) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You don't have enough money to buy this weapon!");
  130.                 GivePlayerWeapon(playerid, 26, 100);
  131.                 GivePlayerMoney(playerid, -800);
  132.                 SendClientMessage(playerid, 0x33CCFFAA, "You have purchased: Swanoff-Sho Gun For $800!");
  133.             }
  134.             if(listitem == 15) //Grenade//
  135.             {
  136.                 if(GetPlayerMoney(playerid) < 2000) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You don't have enough money to buy this weapon!");
  137.                 GivePlayerWeapon(playerid, 16 , 1);
  138.                 GivePlayerMoney(playerid, -2000);
  139.                 SendClientMessage(playerid, 0x33CCFFAA, "You have purchased: Grenade For $2,000!");
  140.             }
  141.             if(listitem == 16) //Molotov//
  142.             {
  143.                 if(GetPlayerMoney(playerid) < 1500) return SendClientMessage(playerid, COLOR_RED, "[ERROR]: You don't have enough money to buy this weapon!");
  144.                 GivePlayerWeapon(playerid, 18, 1);
  145.                 GivePlayerMoney(playerid, -1500);
  146.                 SendClientMessage(playerid, 0x33CCFFAA, "You have purchased: Moltov For $1,500!");
  147.             }
  148.         }
  149.         return 1;
  150.     }
  151.     return 0;
  152. }
  153.  
  154. COMMAND:weapons(playerid, params[])
  155. {
  156.     ShowPlayerDialog(playerid, DIALOG_EWEAPONS, DIALOG_STYLE_LIST, "Easy Weapons", "AK47 ($1,000)\nM4 ($1,000)\nCountry Rifle ($1,200)\nSniper Rifle ($1,800)\nMP5 ($500)\nTec 9 ($500)\nUZI ($500)\nPistol ($200)\nSilenced Pistol ($200)\nDesert Eagle ($250)\nKnife ($50)\nKatana ($100)\nShotgun ($800)\nCombat Shotgun ($800)\nSawnoff Shotgun ($800)\nGrenade ($2,000)\nMolotov ($1,500)\n", "Buy", "Cancel");
  157.     return 1;
  158. }
  159.  
  160. COMMAND:ammo(playerid, params[])
  161. {
  162.     new sz_msg [ 900 ];
  163.     strcat( sz_msg, "[Rifles]: AK-47 [$1,000] || M4 [$1,000] || Country Rifle [$1,200] || Sniper [$1,000]\r\n");
  164.     strcat( sz_msg, "[Sub-Machines]: Tec 9 [$500] || UZI [$500] || MP5 [$500]\r\n");
  165.     strcat( sz_msg, "[Pistols]: Pistol [$200] || Silenced Pistol [$200] || Desert Eagle [$250]\r\n");
  166.     strcat( sz_msg, "[Misc]: Knife [$50] || Katana [$100]\r\n");
  167.     strcat( sz_msg, "[Shotguns]: Shotgun [$800] || Combat Shotgun [$800] || Sawnoff Shotgun [$800]\r\n");
  168.     strcat( sz_msg, "[Explosives]: Grenade [$2,000] || Moltov [$1,500]\r\n");
  169.     ShowPlayerDialog(playerid, DIALOG_EAMMO, DIALOG_STYLE_MSGBOX, "Weapon Ammo", sz_msg, "Close", "");
  170.     return 1;
  171. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement