Advertisement
OtaconEvil

[FS] sistema mochila - BASE - By OTACON

May 15th, 2015
1,635
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.96 KB | None | 0 0
  1. /*
  2.     * ## LEASE ATENTAMENTE PARA NO CONVERTIRSE EN LAMMER!!.: :D ##
  3.     *
  4.     * Estè Simple FILTERSCRIPT esta hecho especialmente para www.forum.sa-mp.com
  5.     * NO Publicar estè FILTERSCRIPT en Otros foros de SA-MP y hacerse pasar por el creador del CODE.
  6.     *
  7.     * Codigo Creado Por OTACON
  8.     *
  9.     * CREDITOS:
  10.     *     OTACON: Realizacion y Idea de creacion del code.
  11.     *     TÙ: Modificacion libremente respetando lo mencionado ;).
  12.     *
  13.     *    NOTA: Menos Creditos para los que me los critican.. JO'PUTAS! :D xD ;)
  14.     *
  15.     *                Prohibido TOTALMENTE el Robo de Créditos o la
  16.     *                  Publicación de este FILTERSCRIPT sin Mi Permiso.
  17. */
  18. /*
  19.     * ## READ CAREFULLY TO AVOID BECOMING LAMMER!.: :D ##
  20.     *
  21.     * This simple FILTERSCRIPT is made especially for www.forum.sa-mp.com
  22.     * DO NOT Post the FILTERSCRIPT in Other SAMP forums and impersonating the creator of the CODE.
  23.     *
  24.     * Code Created By OTACON
  25.     *
  26.     * CREDITS:
  27.     *     OTACON: Idea Making and code creation.
  28.     *     YOUR: Modification freely respecting the above ;).
  29.     *
  30.     *    NOTE: Less Credits for those who criticize me.. JO'PUTAS! :D xD ;)
  31.     *
  32.     *                        FULLY spaces Theft Credit or
  33.     *                 Publication of this FILTERSCRIPT without my permission.
  34. */
  35.  
  36. /*
  37. http://i.imgur.com/zMO8SVe.png
  38. http://i.imgur.com/zMO8SVe.png
  39. http://i.imgur.com/zMO8SVe.png
  40. http://i.imgur.com/zMO8SVe.png
  41. http://i.imgur.com/zMO8SVe.png
  42. */
  43.  
  44. #include <a_samp>
  45. #include <zcmd>
  46.  
  47. #define DIALOG_MOCHILA (1)
  48. #define MAX_SLOTS (10)
  49. enum a_armas{
  50.     armas_guardadas[MAX_SLOTS],
  51.     municion_guardadas[MAX_SLOTS],
  52.     bool:slots_usado[MAX_SLOTS],
  53.     bool:con_mochila,
  54. };
  55. new InfoMochila[MAX_PLAYERS][a_armas];
  56.  
  57. stock menu_Mochila(playerid){
  58.     new data[1024], //esto lo debes cambiar, obvio -.-
  59.         datos[1024],//esto lo debes cambiar, obvio -.-
  60.         gunname[32];
  61.  
  62.     strcat(datos, "Slots\tArma\tMunicion\n");
  63.     for(new index=0; index<MAX_SLOTS; index++){
  64.         new armaid = InfoMochila[playerid][armas_guardadas][index];
  65.         if(InfoMochila[playerid][slots_usado][index]) GetWeaponName(armaid,gunname,sizeof(gunname));
  66.         else gunname = "vacio";
  67.         format(data,sizeof(data),"slot:(%d)\t%s\t%d balas\n", index, gunname, InfoMochila[playerid][municion_guardadas][index]);
  68.         strcat(datos, data);
  69.     }
  70.     ShowPlayerDialog(playerid, DIALOG_MOCHILA+0, DIALOG_STYLE_TABLIST_HEADERS, "Mochila:",datos,"seleccionar", "cancelar");
  71. }
  72.  
  73. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){
  74.  
  75.     switch(dialogid){
  76.         case DIALOG_MOCHILA+0:{
  77.             if(response){
  78.                 if(!InfoMochila[playerid][slots_usado][listitem]){ //guardar
  79.                     if(GetPlayerWeapon(playerid)<=0){ menu_Mochila(playerid);return true; }
  80.                     InfoMochila[playerid][armas_guardadas][listitem] = GetPlayerWeapon(playerid);
  81.                     InfoMochila[playerid][municion_guardadas][listitem] = GetPlayerAmmo(playerid);
  82.                     ResetPlayerWeaponsEx(playerid, GetPlayerWeapon(playerid));
  83.                     SetPlayerArmedWeapon(playerid,0);
  84.                     InfoMochila[playerid][slots_usado][listitem] = true;
  85.                     menu_Mochila(playerid);
  86.                 }else{ // equipar
  87.                     GivePlayerWeapon(playerid, InfoMochila[playerid][armas_guardadas][listitem] ,InfoMochila[playerid][municion_guardadas][listitem]);
  88.                     SetPlayerAmmo(playerid, InfoMochila[playerid][armas_guardadas][listitem] ,InfoMochila[playerid][municion_guardadas][listitem]);
  89.                     InfoMochila[playerid][armas_guardadas][listitem] = 0;
  90.                     InfoMochila[playerid][municion_guardadas][listitem] = 0;
  91.                     InfoMochila[playerid][slots_usado][listitem] = false;
  92.                     menu_Mochila(playerid);
  93.                 }
  94.             }
  95.         }
  96.     }
  97.  
  98.     return false;
  99. }
  100.  
  101. COMMAND:mochila(playerid, params[]){
  102.     menu_Mochila(playerid);
  103.     return true;
  104. }
  105.  
  106. stock ResetPlayerWeaponsEx(playerid, weaponid){
  107. new weapons[13][2];
  108. for (new slots=0; slots<13; slots++){
  109.     if(slots==GetWeaponSlot(weaponid))continue;
  110.     GetPlayerWeaponData(playerid, slots, weapons[slots][0], weapons[slots][1]);
  111. }ResetPlayerWeapons(playerid);
  112. for (new slots=0; slots<13; slots++){
  113.     GivePlayerWeapon(playerid, weapons[slots][0], weapons[slots][1]);
  114.     SetPlayerAmmo(playerid, weapons[slots][0], weapons[slots][1]);
  115. }}
  116. stock GetWeaponSlot(weaponid){
  117. new slots;
  118. switch(weaponid){
  119.     case 0,1:       slots = 0;
  120.     case 2..9:      slots = 1;
  121.     case 10..15:    slots = 10;
  122.     case 16..18,39: slots = 8;
  123.     case 22..24:    slots = 2;
  124.     case 25..27:    slots = 3;
  125.     case 28,29,32:  slots = 4;
  126.     case 30,31:     slots = 5;
  127.     case 33,34:     slots = 6;
  128.     case 35..38:    slots = 7;
  129.     case 40:        slots = 12;
  130.     case 41..43:    slots = 9;
  131.     case 44..46:    slots = 11;
  132. }return slots;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement