Advertisement
gargy001

Random Text FS by DIno / gargy001

Jul 14th, 2014
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.65 KB | None | 0 0
  1. /*
  2. FilterSkripta:
  3. » Upiši random slova
  4.  
  5. Autor:
  6. » » Dino / gargy001 «
  7.  
  8. */
  9.  
  10. #include <a_samp>
  11.  
  12. #if !defined Loop
  13. #define Loop(%0,%1) \
  14. for(new %0 = 0; %0 != %1; %0++)
  15. #endif
  16.  
  17. #if !defined function
  18. #define function%0(%1) \
  19. forward%0(%1); public%0(%1)
  20. #endif
  21.  
  22. #if !defined PURPLE
  23. #define PURPLE \
  24. 0xBF60FFFF
  25. #endif
  26.  
  27. #if !defined GREEN
  28. #define GREEN \
  29. 0x94D317FF
  30. #endif
  31.  
  32. #if !defined TIME
  33. #define TIME \
  34. 180000
  35. #endif
  36.  
  37. new
  38. xCharacters[][] =
  39. {
  40. "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M",
  41. "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
  42. "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
  43. "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",
  44. "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
  45. },
  46. xChars[16] = "",
  47. xReactionTimer,
  48. xCash,
  49. bool: xTestBusy
  50. ;
  51.  
  52. public OnFilterScriptInit()
  53. {
  54. xReactionTimer = SetTimer("xReactionTest", TIME, 1);
  55. return 1;
  56. }
  57.  
  58. public OnFilterScriptExit()
  59. {
  60. KillTimer(xReactionTimer);
  61. return 1;
  62. }
  63.  
  64. public OnPlayerText(playerid, text[])
  65. {
  66. switch(xTestBusy)
  67. {
  68. case true:
  69. {
  70. if(!strcmp(xChars, text, false))
  71. {
  72. new
  73. string[128],
  74. pName[MAX_PLAYER_NAME]
  75. ;
  76. GetPlayerName(playerid, pName, sizeof(pName));
  77. format(string, sizeof(string), "« \%s\" je osvojio ukucao trazena slova najbrze »", pName);
  78. SendClientMessageToAll(GREEN, string);
  79. format(string, sizeof(string), "« Osvojili ste $%d CESTITAMO. »", xCash);
  80. SendClientMessage(playerid, GREEN, string);
  81. GivePlayerMoney(playerid, xCash);
  82. xReactionTimer = SetTimer("xReactionTest", TIME, 1);
  83. xTestBusy = false;
  84. }
  85. }
  86. }
  87. return 1;
  88. }
  89.  
  90. function xReactionProgress()
  91. {
  92. switch(xTestBusy)
  93. {
  94. case true:
  95. {
  96. new
  97. string[128]
  98. ;
  99. format(string, sizeof(string), "« Niko nije unio traženu kombinaciju, nova kombinacija za %d minuta. »", (TIME/60000));
  100. SendClientMessageToAll(PURPLE, string);
  101. xReactionTimer = SetTimer("xReactionTest", TIME, 1);
  102. }
  103. }
  104. return 1;
  105. }
  106.  
  107. function xReactionTest()
  108. {
  109. new
  110. xLength = (random(8) + 2),
  111. string[128]
  112. ;
  113. xCash = (random(1000) + 2000);
  114. format(xChars, sizeof(xChars), "");
  115. Loop(x, xLength) format(xChars, sizeof(xChars), "%s%s", xChars, xCharacters[random(sizeof(xCharacters))][0]);
  116. format(string, sizeof(string), "« Ko prvi unese u chat %s osvaja $%d !!! »", xChars, xCash);
  117. SendClientMessageToAll(PURPLE, string);
  118. KillTimer(xReactionTimer);
  119. xTestBusy = true;
  120. SetTimer("xReactionProgress", 30000, 0);
  121. return 1;
  122. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement