Advertisement
EnzoMetlc

[FilterScript] E-Strlen. Optimiza tus celdas.

Nov 15th, 2013
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.02 KB | None | 0 0
  1. /*
  2.     .-E-Strlen creado por EnzoMetlc.
  3.     FilterScript creado para 'Www.Forum.SA-MP.Com'
  4. */
  5.  
  6.  
  7. #include <a_samp>
  8. #include <zcmd>
  9.  
  10. #define DIALOG_1 590
  11. #define DIALOG_2 591
  12. #define DIALOG_PREGUNTA 592
  13. #define DIALOG_PREGUNTA2 593
  14. #define DIALOG_SUB_FIN 594
  15. #define DIALOG_FIN 595
  16.  
  17. public OnFilterScriptInit()
  18. {
  19.     print("*** E-Strlen FS cargado correctamente.");
  20.     print("*** .-By EnzoMetlc.");
  21.     return 1;
  22. }
  23.  
  24.  
  25. new PlayerName[MAX_PLAYERS];
  26. new Celdas[MAX_PLAYERS];
  27.  
  28.  
  29. public OnPlayerSpawn(playerid)
  30. {
  31.     SendClientMessage(playerid, -1, "*** Utiliza {FF0000}(/Strlen) {FFFFFF}para usar el FS.");
  32.     return 1;
  33. }
  34.  
  35. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  36. {
  37.     switch(dialogid)
  38.     {
  39.         case DIALOG_1:
  40.         {
  41.             if(response)
  42.             {
  43.                 ShowPlayerDialog(playerid, DIALOG_PREGUNTA, DIALOG_STYLE_MSGBOX, "{00FFFF}E_Strlen.", \
  44.                 "{FFFFFF}Desea agregarle 'MAX_PLAYER_NAME' al Texto?.", "Sí", "No");
  45.             }
  46.         }
  47.         case DIALOG_PREGUNTA:
  48.         {
  49.             if(response)
  50.             {
  51.                 PlayerName[playerid] = 24;
  52.                 ShowPlayerDialog(playerid, DIALOG_PREGUNTA2, DIALOG_STYLE_MSGBOX, "{00FFFF}E_Strlen.", \
  53.                 "{FFFFFF}Desea agregar algunas Celdas al Texto?.", "Sí", "No");
  54.             } else
  55.             {
  56.                 PlayerName[playerid] = 0;
  57.                 ShowPlayerDialog(playerid, DIALOG_PREGUNTA2, DIALOG_STYLE_MSGBOX, "{00FFFF}E_Strlen.", \
  58.                 "{FFFFFF}Desea agregar algunas Celdas al Texto?.", "Sí", "No");
  59.             }
  60.         }
  61.         case DIALOG_PREGUNTA2:
  62.         {
  63.             if(response)
  64.             {
  65.                 Celdas[playerid] = strval(inputtext);
  66.                 ShowPlayerDialog(playerid, DIALOG_SUB_FIN, DIALOG_STYLE_INPUT,"{00FFFF}E_Strlen.", \
  67.                 "{FFFFFF}Introduzca las celdas que desea sumar.", "Continuar", "Cancelar");
  68.             } else
  69.             {
  70.                 ShowPlayerDialog(playerid, DIALOG_FIN, DIALOG_STYLE_INPUT, "{00FFFF}E_Strlen.", \
  71.                 "{FFFFFF}Ahora introduzca el Texto que desea optimizar.", "Continuar", "Cancelar");
  72.             }
  73.         }
  74.        
  75.         case DIALOG_SUB_FIN:
  76.         {
  77.             if(response)
  78.             {
  79.                 Celdas[playerid] = strval(inputtext);
  80.                 ShowPlayerDialog(playerid, DIALOG_FIN, DIALOG_STYLE_INPUT, "{00FFFF}E_Strlen.", \
  81.                 "{FFFFFF}Ahora introduzca el Texto que desea optimizar.", "Continuar", "Cancelar");
  82.             }
  83.         }
  84.        
  85.         case DIALOG_FIN:
  86.         {
  87.             if(response)
  88.             {
  89.                 new string[250];
  90.                 format(string, sizeof(string), "{FFFFFF}Si agregó el Nick, ocupa: {FF0000}+24{FFFFFF}. \n\n\
  91.                 Las celdas que agregó son: {FF0000}+%i{FFFFFF} \n\
  92.                 En total son: {FF0000}%i{FFFFFF} celdas.", Celdas[playerid], PlayerName[playerid] + Celdas[playerid] + strlen(inputtext));
  93.                 ShowPlayerDialog(playerid, 785, DIALOG_STYLE_MSGBOX, "{00FFFF}E_Strlen", string, "Aceptar", "");
  94.                 SendClientMessageToAll(-1, inputtext);
  95.             }
  96.         }
  97.     }
  98.     return 1;
  99. }
  100.  
  101.  
  102. CMD:strlen(playerid, params[])
  103. {
  104.     PlayerName[playerid] = 0;
  105.     Celdas[playerid] = 0;
  106.     ShowPlayerDialog(playerid, DIALOG_1, DIALOG_STYLE_MSGBOX, "{00FFFF}E_Strlen.", \
  107.     "{FFFFFF}Pulse 'Continuar' para hacer la optimización. \nDe lo contrario, pulse 'Cancelar'.", "Continuar", "Cancelar");
  108.     return 1;
  109. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement