SHARE
TWEET

[FS] FilterScript Seletor de Armas

Chip7 Jun 12th, 2012 247 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*VISITE NOSSO SITE: http://www.sampknd.com/
  2.   SAMP KND MELHOR BLOG DE SAMP DO BRASIL
  3. */
  4.  
  5. #define FILTERSCRIPT
  6.  
  7. #include <a_samp>
  8.  
  9. #if defined FILTERSCRIPT
  10. new iArmaatual[MAX_PLAYERS];
  11. new listitems[] = "1\tDesert Eagle\n2\tGranadas\n3\tSawn-Off Shotgun\n4\tMolotov\n5\tLançador de Misseis7\n6\tAK47\n7\tM4\n";
  12. //
  13. forward OnPlayerChangeWeapon(playerid, oldweapon, newweapon);
  14. public OnFilterScriptInit()
  15. {
  16.     print("\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  17.     print("           Seletor de Armas             ");
  18.     print("               by Hades                 ");
  19.     print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
  20.     return 1;
  21. }
  22.  
  23. public OnFilterScriptExit()
  24. {
  25.     return 1;
  26. }
  27.  
  28. #else
  29.  
  30. main()
  31. {
  32.     print("\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  33.     print("       Finalizando FilterScript     ");
  34.     print("          Seletor de Armas          ");
  35.     print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
  36. }
  37.  
  38. #endif
  39.  
  40. public OnPlayerUpdate(playerid)
  41. {
  42.     new iCurWeap = GetPlayerWeapon(playerid);
  43.     if(iCurWeap != iArmaatual[playerid])
  44.     {
  45.  
  46.         OnPlayerChangeWeapon(playerid, iArmaatual[playerid], iCurWeap);
  47.         iArmaatual[playerid] = iCurWeap;
  48.     }
  49.     return 1;
  50. }
  51. public OnPlayerChangeWeapon(playerid, oldweapon, newweapon)
  52. {
  53.     new     s[128],
  54.         oWeapon[24],
  55.         nWeapon[24];
  56.  
  57.     GetWeaponName(oldweapon, oWeapon, sizeof(oWeapon));
  58.     GetWeaponName(newweapon, nWeapon, sizeof(nWeapon));
  59.     format(s, sizeof(s), "Você já trocou as armas.");
  60.     format(s, sizeof(s), "Sua arma velha era : %s agora a nova é : %s!", oWeapon, nWeapon);
  61.     SendClientMessage(playerid, 0xFFFFFFFF, s);
  62. }
  63. public OnPlayerCommandText(playerid, cmdtext[])
  64. {
  65.     if (strcmp("/carma", cmdtext, true, 10) == 0)
  66.     {
  67.         ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"Lista de Armas :",listitems,"Comprar","Cancelar");
  68.         return 1;
  69.     }
  70.     return 0;
  71. }
  72. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  73. {
  74.     if(dialogid == 2) {
  75.         if(response) {
  76.             new message[256+1];
  77.             if(listitem == 0) {
  78.                 format(message, 256, "Você escolheu : 'Desert Eagle'", listitem);
  79.                 SendClientMessage(playerid, 0xFFFFFFFF, message);
  80.                 GivePlayerMoney(playerid, -150);
  81.                 GivePlayerWeapon (playerid, 24, 500);
  82.             } else if(listitem == 1) {
  83.                 format(message, 256, "Você escolheu : 'Granadas'", listitem);
  84.                 SendClientMessage(playerid, 0xFFFFFFFF, message);
  85.                 GivePlayerMoney(playerid, -290);
  86.                 GivePlayerWeapon (playerid, 16, 20);
  87.             } else if(listitem == 2) {
  88.                 format(message, 256, "Você escolheu : 'Sawn-Off Shotgun'", listitem);
  89.                 SendClientMessage(playerid, 0xFFFFFFFF, message);
  90.                 GivePlayerMoney(playerid, -500);
  91.                 GivePlayerWeapon (playerid, 26, 500);
  92.             } else if(listitem == 3) {
  93.                 format(message, 256, "Você escolheu : 'Molotov'", listitem);
  94.                 SendClientMessage(playerid, 0xFFFFFFFF, message);
  95.                 GivePlayerMoney(playerid, -400);
  96.                 GivePlayerWeapon (playerid, 18, 100);
  97.             } else if(listitem == 4) {
  98.                 format(message, 256, "Você escolheu : 'Lançador de Misseis'", listitem);
  99.                 SendClientMessage(playerid, 0xFFFFFFFF, message);
  100.                 GivePlayerMoney(playerid, -20000);
  101.                 GivePlayerWeapon (playerid, 35, 500);
  102.             } else if(listitem == 5) {
  103.                 format(message, 256, "Você escolheu : 'AK47'", listitem);
  104.                 SendClientMessage(playerid, 0xFFFFFFFF, message);
  105.                 GivePlayerMoney(playerid, -300);
  106.                 GivePlayerWeapon (playerid, 30, 500);
  107.             } else if(listitem == 6) {
  108.                 format(message, 256, "Você escolheu : 'M4'", listitem);
  109.                 SendClientMessage(playerid, 0xFFFFFFFF, message);
  110.                 GivePlayerMoney(playerid, -300);
  111.                 GivePlayerWeapon (playerid, 31, 500);
  112. }
  113. }
  114. }
  115.     return 1;
  116. }
  117.  
  118. ///////  //            //             //
  119. //       //          ////           ////
  120. //////   //        //   //        //   //
  121. //       //      //      //     //      //
  122. //       //    //         //  //         //
  123. //       //  //            ///            //
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top