Badyx

[FS] Profesor V1.0.

Aug 11th, 2013
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 7.16 KB | None | 0 0
  1. /*
  2.         Sistema Profesor Pawn By Badyx
  3.                                                         */
  4.  
  5. /*      Creditos:
  6.  
  7.         Badyx               Idea, Script y tester.
  8.  
  9.         Datos:
  10.  
  11.         Tiempo              30 minutos sin prisa.
  12.         Bugs                No conocidos.
  13.  
  14.         Informacion adicional:
  15.  
  16.         Todo el sistema esta por dialog.
  17.  
  18.         Un único comando /Profesor.
  19.         No deben de tener en uso los dialogs desde el 2000 al   2005.
  20.  
  21.         Imagenes:
  22.  
  23.  
  24.        
  25.  
  26. */
  27. #include <a_samp>
  28.  
  29. new Acierto[MAX_PLAYERS];
  30.  
  31. #define Comenzar 5000
  32. #define Pregunta2 5001
  33. #define Pregunta3 5002
  34. #define Pregunta4 5003
  35. #define Pregunta5 5004
  36. #define Pregunta6 5005
  37.  
  38. #if defined FILTERSCRIPT
  39.  
  40. #else
  41.  
  42. main(){}
  43.  
  44. #endif
  45.  
  46. public OnPlayerConnect(playerid)
  47. {
  48.     Acierto[playerid] = 0;
  49.     return 1;
  50. }
  51.  
  52. public OnPlayerCommandText(playerid, cmdtext[])
  53. {
  54.  
  55.     if (strcmp("/Profesor", cmdtext, true, 10) == 0)
  56.     {
  57.         ShowPlayerDialog(playerid,Comenzar, DIALOG_STYLE_LIST, "¿Cual de estas opciones seria correcta para definir una variable?", "NeW MiVaRiAbLe[MaX_PlAyErId]\nnew MiVariable[playerid]\nnew MiVariable[MAX_PLAYERS]", "Responder", "");
  58.         return 1;
  59.     }
  60.  
  61.    
  62.     return 0;
  63. }
  64.  
  65.  
  66. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  67. {
  68.     if(dialogid == Comenzar)
  69.     {
  70.     if(response)
  71.     {
  72.     if(listitem == 0)
  73.     {
  74.         ShowPlayerDialog(playerid,Pregunta2, DIALOG_STYLE_LIST, "¿Como definirias una variable bool?", "new bool:MiVariable[MAX_PLAYERS];\nnew booludo:MiVariable[MAX_PLAYERS];\nnew MiVariable[MAX_PLAYERS]", "Responder", "");
  75.  
  76.     }
  77.     if(listitem == 1)
  78.     {
  79.         ShowPlayerDialog(playerid,Pregunta2, DIALOG_STYLE_LIST, "¿Como definirias una variable bool?", "new bool:MiVariable[MAX_PLAYERS];\nnew booludo:MiVariable[MAX_PLAYERS];\nnew MiVariable[MAX_PLAYERS]", "Responder", "");
  80.     }
  81.     if(listitem == 2)
  82.     {
  83.         Acierto[playerid] += 1;
  84.        
  85.         ShowPlayerDialog(playerid,Pregunta2, DIALOG_STYLE_LIST, "¿Como definirias una variable bool?", "new bool:MiVariable[MAX_PLAYERS];\nnew booludo:MiVariable[MAX_PLAYERS];\nnew MiVariable[MAX_PLAYERS]", "Responder", "");
  86.     }
  87.     }
  88.     return 1;
  89.     }
  90.    
  91.     if(dialogid == Pregunta2)
  92.     {
  93.     if(response)
  94.     {
  95.     if(listitem == 0)
  96.     {
  97.         Acierto[playerid] += 1;
  98.         ShowPlayerDialog(playerid,Pregunta3, DIALOG_STYLE_LIST, "¿Como sumarias la cantidad 5 a una variable bool?", "MiVariable[playerid] = 5;\nMiVariable[playerid] += 5;\nSeria imposible", "Responder", "");
  99.     }
  100.    
  101.     if(listitem == 1)
  102.     {
  103.         ShowPlayerDialog(playerid,Pregunta3, DIALOG_STYLE_LIST, "¿Como sumarias la cantidad 5 a una variable bool?", "MiVariable[playerid] = 5;\nMiVariable[playerid] += 5;\nSeria imposible", "Responder", "");
  104.     }
  105.    
  106.     if(listitem == 2)
  107.     {
  108.         ShowPlayerDialog(playerid,Pregunta3, DIALOG_STYLE_LIST, "¿Como sumarias la cantidad 5 a una variable bool?", "MiVariable[playerid] = 5;\nMiVariable[playerid] += 5;\nSeria imposible", "Responder", "");
  109.     }
  110.     }
  111.     return 1;
  112.     }
  113.    
  114.    
  115.     if(dialogid == Pregunta3)
  116.     {
  117.     if(response)
  118.     {
  119.     if(listitem == 0)
  120.     {
  121.         ShowPlayerDialog(playerid,Pregunta4, DIALOG_STYLE_LIST, "¿Como sumarias la cantidad 5 a una variable tipo new MiVariable[MAX_PLAYERS];?", "MiVariable[playerid] = 5;\nMiVariable[playerid] += 5;\nMiVariable[playerid] += false =5;", "Responder", "");
  122.  
  123.     }
  124.     if(listitem == 1)
  125.     {
  126.         ShowPlayerDialog(playerid,Pregunta4, DIALOG_STYLE_LIST, "¿Como sumarias la cantidad 5 a una variable tipo new MiVariable[MAX_PLAYERS];?", "MiVariable[playerid] = 5;\nMiVariable[playerid] += 5;\nMiVariable[playerid] += false =5;", "Responder", "");
  127.  
  128.     }
  129.     if(listitem == 2)
  130.     {
  131.         Acierto[playerid] += 1;
  132.        
  133.         ShowPlayerDialog(playerid,Pregunta4, DIALOG_STYLE_LIST, "¿Como sumarias la cantidad 5 a una variable tipo new MiVariable[MAX_PLAYERS];?", "MiVariable[playerid] = 5;\nMiVariable[playerid] += 5;\nMiVariable[playerid] += false =5;", "Responder", "");
  134.     }
  135.     }
  136.     return 1;
  137.     }
  138.    
  139.     if(dialogid == Pregunta4)
  140.     {
  141.     if(response)
  142.     {
  143.     if(listitem == 0)
  144.     {
  145.         ShowPlayerDialog(playerid,Pregunta5, DIALOG_STYLE_LIST, "¿Como setearias la cantidad 5 a una variable tipo new MiVariable[MAX_PLAYERS];?", "MiVariable[playerid] = 5;\nMiVariable[playerid] == 5;\nMiVariable[playerid] -= 5;", "Responder", "");
  146.  
  147.     }
  148.    
  149.     if(listitem == 1)
  150.     {
  151.         Acierto[playerid] += 1;
  152.        
  153.         ShowPlayerDialog(playerid,Pregunta5, DIALOG_STYLE_LIST, "¿Como setearias la cantidad 5 a una variable tipo new MiVariable[MAX_PLAYERS];?", "MiVariable[playerid] = 5;\nMiVariable[playerid] == 5;\nMiVariable[playerid] -= 5;", "Responder", "");
  154.  
  155.     }
  156.  
  157.     if(listitem == 2)
  158.     {
  159.         ShowPlayerDialog(playerid,Pregunta5, DIALOG_STYLE_LIST, "¿Como setearias la cantidad 5 a una variable tipo new MiVariable[MAX_PLAYERS];?", "MiVariable[playerid] = 5;\nMiVariable[playerid] == 5;\nMiVariable[playerid] -= 5;", "Responder", "");
  160.  
  161.     }
  162.     }
  163.     return 1;
  164. }
  165.  
  166.  
  167.     if(dialogid == Pregunta5)
  168.     {
  169.     if(response)
  170.     {
  171.     if(listitem == 0)
  172.     {
  173.         Acierto[playerid] += 1;
  174.         ShowPlayerDialog(playerid,Pregunta6, DIALOG_STYLE_LIST, "¿Como restarias la cantidad 5 a una variable tipo new MiVariable[MAX_PLAYERS];?", "MiVariable[playerid] += 5;\nMiVariable[playerid] == 5;\nMiVariable[playerid] -= 5;", "Responder", "");
  175.     }
  176.  
  177.     if(listitem == 1)
  178.     {
  179.         ShowPlayerDialog(playerid,Pregunta6, DIALOG_STYLE_LIST, "¿Como restarias la cantidad 5 a una variable tipo new MiVariable[MAX_PLAYERS];?", "MiVariable[playerid] += 5;\nMiVariable[playerid] == 5;\nMiVariable[playerid] -= 5;", "Responder", "");
  180.     }
  181.  
  182.     if(listitem == 2)
  183.     {
  184.         ShowPlayerDialog(playerid,Pregunta6, DIALOG_STYLE_LIST, "¿Como restarias la cantidad 5 a una variable tipo new MiVariable[MAX_PLAYERS];?", "MiVariable[playerid] += 5;\nMiVariable[playerid] == 5;\nMiVariable[playerid] -= 5;", "Responder", "");
  185.     }
  186.     }
  187.     return 1;
  188. }
  189.  
  190.     if(dialogid == Pregunta6)
  191.     {
  192.     if(response)
  193.     {
  194.     if(listitem == 0)
  195.     {
  196.         ComprobarNota(playerid);
  197.     }
  198.  
  199.     if(listitem == 1)
  200.     {
  201.         ComprobarNota(playerid);
  202.     }
  203.  
  204.     if(listitem == 2)
  205.     {
  206.         Acierto[playerid] += 1;
  207.         ComprobarNota(playerid);
  208.     }
  209.     }
  210.     return 1;
  211.     }
  212.  
  213.     return 1;
  214. }
  215.  
  216.  
  217. forward ComprobarNota(playerid);
  218. public ComprobarNota(playerid)
  219. {
  220.     new string[100];
  221.     LimpiarChat(playerid,60);
  222.     format(string, sizeof(string), "[Profesor] Tu nota es de %d", Acierto[playerid]);
  223.     SendClientMessage(playerid, -1, string);
  224.     switch(Acierto[playerid])
  225.     {
  226.     case 0: SendClientMessage(playerid, -1, "[Profesor] Mejor pegate un tiro");
  227.     case 1: SendClientMessage(playerid, -1, "[Profesor] Solo una palabra. (Burro)");
  228.     case 2: SendClientMessage(playerid, -1, "[Profesor] Eres malo hasta decir basta");
  229.     case 3: SendClientMessage(playerid, -1, "[Profesor] ¿Realmente no te da verguenza?");
  230.     case 4: SendClientMessage(playerid, -1, "[Profesor] Deberias replantearte si el script es lo tuyo");
  231.     case 5: SendClientMessage(playerid, -1, "[Profesor] Enhorabuena, eres el puto amo del script");
  232.     }
  233.     Acierto[playerid] = 0;
  234.     return 1;
  235. }
  236.  
  237. forward LimpiarChat(playerid, Lineas);
  238. public LimpiarChat(playerid, Lineas)
  239. {
  240.     if (IsPlayerConnected(playerid))
  241.     {
  242.         for(new i=0; i<Lineas; i++)
  243.         {
  244.             SendClientMessage(playerid, -1, " ");
  245.         }
  246.     }
  247.     return 1;
  248. }
Advertisement
Add Comment
Please, Sign In to add comment