Guest User

Untitled

a guest
May 21st, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.39 KB | None | 0 0
  1. #include <a_samp>
  2. #include <sscanf2>
  3. #include <zcmd>
  4.  
  5. #define COLOR_INFO 0xFFFFFFFF
  6.  
  7. new Text:txt_GrattaVinci;
  8. new Text:txt_Block1;
  9. new Text:txt_Block2;
  10. new Text:txt_Block3;
  11. new Text:txt_Num1;
  12. new Text:txt_Num2;
  13. new Text:txt_Num3;
  14. new Text:txt_E;
  15.  
  16. new RandomNums[][] =
  17. {
  18.     "3",
  19.     "2"
  20. };
  21.  
  22. forward GrattaVinciEnter(playerid);
  23. forward Num_1(playerid);
  24. forward Num_2(playerid);
  25. forward Num_3(playerid);
  26. forward GrattaVinciExit(playerid);
  27. forward GrattaVinciFinished(playerid);
  28.  
  29. public OnFilterScriptInit()
  30. {
  31.     txt_GrattaVinci = TextDrawCreate(250.000000, 131.000000, "Gratta     Vinci");
  32.     TextDrawAlignment(txt_GrattaVinci, 2);
  33.     TextDrawBackgroundColor(txt_GrattaVinci, 255);
  34.     TextDrawFont(txt_GrattaVinci, 1);
  35.     TextDrawLetterSize(txt_GrattaVinci, 0.500000, 7.199995);
  36.     TextDrawColor(txt_GrattaVinci, -65281);
  37.     TextDrawSetOutline(txt_GrattaVinci, 1);
  38.     TextDrawSetProportional(txt_GrattaVinci, 1);
  39.     TextDrawUseBox(txt_GrattaVinci, 1);
  40.     TextDrawBoxColor(txt_GrattaVinci, -65281);
  41.     TextDrawTextSize(txt_GrattaVinci, 0.000000, 224.000000);
  42.  
  43.     txt_Block1 = TextDrawCreate(161.000000, 154.000000, "0");
  44.     TextDrawAlignment(txt_Block1, 2);
  45.     TextDrawBackgroundColor(txt_Block1, 255);
  46.     TextDrawFont(txt_Block1, 1);
  47.     TextDrawLetterSize(txt_Block1, 0.500000, 2.000000);
  48.     TextDrawColor(txt_Block1,255);
  49.     TextDrawSetOutline(txt_Block1, 0);
  50.     TextDrawSetProportional(txt_Block1, 1);
  51.     TextDrawSetShadow(txt_Block1, 1);
  52.     TextDrawUseBox(txt_Block1, 1);
  53.     TextDrawBoxColor(txt_Block1, 255);
  54.     TextDrawTextSize(txt_Block1, 0.000000, 29.000000);
  55.  
  56.     txt_Block2 = TextDrawCreate(258.000000, 155.000000, "0");
  57.     TextDrawAlignment(txt_Block2, 2);
  58.     TextDrawBackgroundColor(txt_Block2, 255);
  59.     TextDrawFont(txt_Block2, 1);
  60.     TextDrawLetterSize(txt_Block2, 0.500000, 2.000000);
  61.     TextDrawColor(txt_Block2, 255);
  62.     TextDrawSetOutline(txt_Block2, 0);
  63.     TextDrawSetProportional(txt_Block2, 1);
  64.     TextDrawSetShadow(txt_Block2, 1);
  65.     TextDrawUseBox(txt_Block2, 1);
  66.     TextDrawBoxColor(txt_Block2, 255);
  67.     TextDrawTextSize(txt_Block2, 0.000000, 29.000000);
  68.  
  69.     txt_Block3 = TextDrawCreate(338.000000, 155.000000, "0");
  70.     TextDrawAlignment(txt_Block3, 2);
  71.     TextDrawBackgroundColor(txt_Block3, 255);
  72.     TextDrawFont(txt_Block3, 1);
  73.     TextDrawLetterSize(txt_Block3, 0.500000, 2.000000);
  74.     TextDrawColor(txt_Block3, 255);
  75.     TextDrawSetOutline(txt_Block3, 0);
  76.     TextDrawSetProportional(txt_Block3, 1);
  77.     TextDrawSetShadow(txt_Block3, 1);
  78.     TextDrawUseBox(txt_Block3, 1);
  79.     TextDrawBoxColor(txt_Block3, 255);
  80.     TextDrawTextSize(txt_Block3, 0.000000, 29.000000);
  81.  
  82.     txt_Num1 = TextDrawCreate(161.000000, 154.000000, "");
  83.     TextDrawAlignment(txt_Num1, 2);
  84.     TextDrawBackgroundColor(txt_Num1, 255);
  85.     TextDrawFont(txt_Num1, 1);
  86.     TextDrawLetterSize(txt_Num1, 0.500000, 2.000000);
  87.     TextDrawColor(txt_Num1, 16711935);
  88.     TextDrawSetOutline(txt_Num1, 0);
  89.     TextDrawSetProportional(txt_Num1, 1);
  90.     TextDrawSetShadow(txt_Num1, 1);
  91.     TextDrawUseBox(txt_Num1, 1);
  92.     TextDrawBoxColor(txt_Num1, -1);
  93.     TextDrawTextSize(txt_Num1, 0.000000, 29.000000);
  94.  
  95.     txt_Num2 = TextDrawCreate(258.000000, 155.000000, "");
  96.     TextDrawAlignment(txt_Num2, 2);
  97.     TextDrawBackgroundColor(txt_Num2, 255);
  98.     TextDrawFont(txt_Num2, 1);
  99.     TextDrawLetterSize(txt_Num2, 0.500000, 2.000000);
  100.     TextDrawColor(txt_Num2, 16711935);
  101.     TextDrawSetOutline(txt_Num2, 0);
  102.     TextDrawSetProportional(txt_Num2, 1);
  103.     TextDrawSetShadow(txt_Num2, 1);
  104.     TextDrawUseBox(txt_Num2, 1);
  105.     TextDrawBoxColor(txt_Num2, -1);
  106.     TextDrawTextSize(txt_Num2, 0.000000, 29.000000);
  107.  
  108.     txt_Num3 = TextDrawCreate(338.000000, 155.000000, "");
  109.     TextDrawAlignment(txt_Num3, 2);
  110.     TextDrawBackgroundColor(txt_Num3, 255);
  111.     TextDrawFont(txt_Num3, 1);
  112.     TextDrawLetterSize(txt_Num3, 0.500000, 2.000000);
  113.     TextDrawColor(txt_Num3, 16711935);
  114.     TextDrawSetOutline(txt_Num3, 0);
  115.     TextDrawSetProportional(txt_Num3, 1);
  116.     TextDrawSetShadow(txt_Num3, 1);
  117.     TextDrawUseBox(txt_Num3, 1);
  118.     TextDrawBoxColor(txt_Num3, -1);
  119.     TextDrawTextSize(txt_Num3, 0.000000, 29.000000);
  120.  
  121.     txt_E = TextDrawCreate(251.000000, 172.000000, "&");
  122.     TextDrawBackgroundColor(txt_E, 255);
  123.     TextDrawFont(txt_E, 1);
  124.     TextDrawLetterSize(txt_E, 0.609999, 2.200000);
  125.     TextDrawColor(txt_E, -65281);
  126.     TextDrawSetOutline(txt_E, 1);
  127.     TextDrawSetProportional(txt_E, 1);
  128.     return 1;
  129. }
  130.  
  131. public OnFilterScriptExit()
  132. {
  133.     TextDrawDestroy(txt_GrattaVinci);
  134.     TextDrawDestroy(txt_Block1);
  135.     TextDrawDestroy(txt_Block2);
  136.     TextDrawDestroy(txt_Block3);
  137.     TextDrawDestroy(txt_Num1);
  138.     TextDrawDestroy(txt_Num2);
  139.     TextDrawDestroy(txt_Num3);
  140.     TextDrawDestroy(txt_E);
  141.     return 1;
  142. }
  143. COMMAND:grattaevinci(playerid,params[])
  144. {
  145.     SetTimer("GrattaVinciEnter", 500, 0);
  146.     SetTimer("Num_1", 3500, 0);
  147.     SetTimer("Num_2", 6500, 0);
  148.     SetTimer("Num_3", 9500, 0);
  149.     SetTimer("GrattaVinciFinished", 14000, 0);
  150.     SetTimer("GrattaVinciExit", 15000, 0);
  151.     return 1;
  152. }
  153. public GrattaVinciEnter(playerid)
  154. {
  155.     SendClientMessage(playerid, COLOR_INFO,"[Info:] Hai ricevuto un Gratta & Vinci");
  156.     TextDrawShowForPlayer(playerid, txt_GrattaVinci);
  157.     TextDrawShowForPlayer(playerid, txt_Block1);
  158.     TextDrawShowForPlayer(playerid, txt_Block2);
  159.     TextDrawShowForPlayer(playerid, txt_Block3);
  160.     TextDrawShowForPlayer(playerid, txt_E);
  161.     return 1;
  162. }
  163. public Num_1(playerid)
  164. {
  165.     SendClientMessage(playerid, COLOR_INFO,"[Info:] Hai grattato la prima casella");
  166.     TextDrawHideForPlayer(playerid, txt_Block1);
  167.     TextDrawShowForPlayer(playerid, txt_Num1);
  168.     TextDrawSetString(txt_Num1, RandomNums[random(sizeof(RandomNums))]);
  169.     return 1;
  170. }
  171. public Num_2(playerid)
  172. {
  173.     SendClientMessage(playerid, COLOR_INFO,"[Info:] Hai grattato la seconda casella");
  174.     TextDrawHideForPlayer(playerid, txt_Block2);
  175.     TextDrawShowForPlayer(playerid, txt_Num2);
  176.     TextDrawSetString(txt_Num2, RandomNums[random(sizeof(RandomNums))]);
  177.     return 1;
  178. }
  179. public Num_3(playerid)
  180. {
  181.     SendClientMessage(playerid, COLOR_INFO,"[Info:] Hai grattato la terza casella");
  182.     TextDrawHideForPlayer(playerid, txt_Block3);
  183.     TextDrawShowForPlayer(playerid, txt_Num3);
  184.     TextDrawSetString(txt_Num3, RandomNums[random(sizeof(RandomNums))]);
  185.     return 1;
  186. }
  187. public GrattaVinciFinished(playerid)
  188. {
  189.     if((txt_Num1, txt_Num2 = txt_Num3))
  190.     {
  191.         SendClientMessage(playerid, COLOR_INFO, "Hai Vinto");
  192.     }
  193.     return 1;
  194. }
  195. public GrattaVinciExit(playerid)
  196. {
  197.     TextDrawHideForPlayer(playerid, txt_GrattaVinci);
  198.     TextDrawHideForPlayer(playerid, txt_Num1);
  199.     TextDrawHideForPlayer(playerid, txt_Num2);
  200.     TextDrawHideForPlayer(playerid, txt_Num3);
  201.     TextDrawHideForPlayer(playerid, txt_E);
  202.     return 1;
  203. }
Add Comment
Please, Sign In to add comment