Advertisement
Guest User

Untitled

a guest
Jul 21st, 2021
582
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.40 KB | None | 0 0
  1. // ========================================================================== //
  2. /*
  3. F I L T E R S C R I P T
  4.  
  5. grebgreb sreckice
  6.  
  7. @AUTHOR: tayloR
  8. */
  9. // ========================================================================== //
  10.  
  11. // Includes
  12. #include <a_samp>
  13. #include <YSI/y_commands>
  14.  
  15.  
  16. // Player variable
  17. new _grebgreb[MAX_PLAYERS][3][3];
  18. new bool:_grebActive[MAX_PLAYERS];
  19.  
  20. // Player textdraw
  21. new PlayerText:GrebGreb[MAX_PLAYERS][20];
  22.  
  23.  
  24. // Dialog ID
  25. #define DIALOG_GREBGREB 1
  26.  
  27. public OnFilterScriptInit() {
  28. return 1;
  29. }
  30.  
  31. public OnFilterScriptExit() {
  32. return 1;
  33. }
  34.  
  35. public OnPlayerDisconnect(playerid) {
  36. var_reset(playerid);
  37. return 1;
  38. }
  39.  
  40. public OnPlayerConnect(playerid) {
  41.  
  42. GrebGreb[playerid][0] = CreatePlayerTextDraw(playerid, 52.047660, 172.493316, "LD_SPAC:white");
  43. PlayerTextDrawTextSize(playerid, GrebGreb[playerid][0], 206.000000, 155.000000);
  44. PlayerTextDrawAlignment(playerid, GrebGreb[playerid][0], 1);
  45. PlayerTextDrawColor(playerid, GrebGreb[playerid][0], 255);
  46. PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][0], 0);
  47. PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][0], 255);
  48. PlayerTextDrawFont(playerid, GrebGreb[playerid][0], 4);
  49. PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][0], 0);
  50.  
  51. GrebGreb[playerid][1] = CreatePlayerTextDraw(playerid, 56.238136, 204.919952, "LD_SPAC:white");
  52. PlayerTextDrawTextSize(playerid, GrebGreb[playerid][1], 99.000000, 101.000000);
  53. PlayerTextDrawAlignment(playerid, GrebGreb[playerid][1], 1);
  54. PlayerTextDrawColor(playerid, GrebGreb[playerid][1], 16711935);
  55. PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][1], 0);
  56. PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][1], 255);
  57. PlayerTextDrawFont(playerid, GrebGreb[playerid][1], 4);
  58. PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][1], 0);
  59.  
  60. GrebGreb[playerid][2] = CreatePlayerTextDraw(playerid, 120.476173, 177.626678, "GREB-GREB");
  61. PlayerTextDrawLetterSize(playerid, GrebGreb[playerid][2], 0.400000, 1.600000);
  62. PlayerTextDrawAlignment(playerid, GrebGreb[playerid][2], 1);
  63. PlayerTextDrawColor(playerid, GrebGreb[playerid][2], 16711935);
  64. PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][2], 0);
  65. PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][2], 255);
  66. PlayerTextDrawFont(playerid, GrebGreb[playerid][2], 1);
  67. PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][2], 1);
  68.  
  69. GrebGreb[playerid][3] = CreatePlayerTextDraw(playerid, 60.428623, 215.159942, "ld_pool:ball");
  70. PlayerTextDrawTextSize(playerid, GrebGreb[playerid][3], 24.000000, 26.000000);
  71. PlayerTextDrawAlignment(playerid, GrebGreb[playerid][3], 1);
  72. PlayerTextDrawColor(playerid, GrebGreb[playerid][3], -1);
  73. PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][3], 0);
  74. PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][3], 255);
  75. PlayerTextDrawFont(playerid, GrebGreb[playerid][3], 4);
  76. PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][3], 0);
  77. PlayerTextDrawSetSelectable(playerid, GrebGreb[playerid][3], true);
  78.  
  79. GrebGreb[playerid][4] = CreatePlayerTextDraw(playerid, 60.809574, 243.319915, "ld_pool:ball");
  80. PlayerTextDrawTextSize(playerid, GrebGreb[playerid][4], 24.000000, 26.000000);
  81. PlayerTextDrawAlignment(playerid, GrebGreb[playerid][4], 1);
  82. PlayerTextDrawColor(playerid, GrebGreb[playerid][4], -1);
  83. PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][4], 0);
  84. PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][4], 255);
  85. PlayerTextDrawFont(playerid, GrebGreb[playerid][4], 4);
  86. PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][4], 0);
  87. PlayerTextDrawSetSelectable(playerid, GrebGreb[playerid][4], true);
  88.  
  89. GrebGreb[playerid][5] = CreatePlayerTextDraw(playerid, 61.190525, 271.906555, "ld_pool:ball");
  90. PlayerTextDrawTextSize(playerid, GrebGreb[playerid][5], 24.000000, 26.000000);
  91. PlayerTextDrawAlignment(playerid, GrebGreb[playerid][5], 1);
  92. PlayerTextDrawColor(playerid, GrebGreb[playerid][5], -1);
  93. PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][5], 0);
  94. PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][5], 255);
  95. PlayerTextDrawFont(playerid, GrebGreb[playerid][5], 4);
  96. PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][5], 0);
  97. PlayerTextDrawSetSelectable(playerid, GrebGreb[playerid][5], true);
  98.  
  99. GrebGreb[playerid][6] = CreatePlayerTextDraw(playerid, 91.285789, 214.306625, "ld_pool:ball");
  100. PlayerTextDrawTextSize(playerid, GrebGreb[playerid][6], 24.000000, 26.000000);
  101. PlayerTextDrawAlignment(playerid, GrebGreb[playerid][6], 1);
  102. PlayerTextDrawColor(playerid, GrebGreb[playerid][6], -1);
  103. PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][6], 0);
  104. PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][6], 255);
  105. PlayerTextDrawFont(playerid, GrebGreb[playerid][6], 4);
  106. PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][6], 0);
  107. PlayerTextDrawSetSelectable(playerid, GrebGreb[playerid][6], true);
  108.  
  109. GrebGreb[playerid][7] = CreatePlayerTextDraw(playerid, 91.666740, 243.319931, "ld_pool:ball");
  110. PlayerTextDrawTextSize(playerid, GrebGreb[playerid][7], 24.000000, 26.000000);
  111. PlayerTextDrawAlignment(playerid, GrebGreb[playerid][7], 1);
  112. PlayerTextDrawColor(playerid, GrebGreb[playerid][7], -1);
  113. PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][7], 0);
  114. PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][7], 255);
  115. PlayerTextDrawFont(playerid, GrebGreb[playerid][7], 4);
  116. PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][7], 0);
  117. PlayerTextDrawSetSelectable(playerid, GrebGreb[playerid][7], true);
  118.  
  119. GrebGreb[playerid][8] = CreatePlayerTextDraw(playerid, 92.047698, 272.333251, "ld_pool:ball");
  120. PlayerTextDrawTextSize(playerid, GrebGreb[playerid][8], 24.000000, 26.000000);
  121. PlayerTextDrawAlignment(playerid, GrebGreb[playerid][8], 1);
  122. PlayerTextDrawColor(playerid, GrebGreb[playerid][8], -1);
  123. PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][8], 0);
  124. PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][8], 255);
  125. PlayerTextDrawFont(playerid, GrebGreb[playerid][8], 4);
  126. PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][8], 0);
  127. PlayerTextDrawSetSelectable(playerid, GrebGreb[playerid][8], true);
  128.  
  129. GrebGreb[playerid][9] = CreatePlayerTextDraw(playerid, 123.285797, 214.733306, "ld_pool:ball");
  130. PlayerTextDrawTextSize(playerid, GrebGreb[playerid][9], 24.000000, 26.000000);
  131. PlayerTextDrawAlignment(playerid, GrebGreb[playerid][9], 1);
  132. PlayerTextDrawColor(playerid, GrebGreb[playerid][9], -1);
  133. PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][9], 0);
  134. PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][9], 255);
  135. PlayerTextDrawFont(playerid, GrebGreb[playerid][9], 4);
  136. PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][9], 0);
  137. PlayerTextDrawSetSelectable(playerid, GrebGreb[playerid][9], true);
  138.  
  139. GrebGreb[playerid][10] = CreatePlayerTextDraw(playerid, 123.285812, 243.746612, "ld_pool:ball");
  140. PlayerTextDrawTextSize(playerid, GrebGreb[playerid][10], 24.000000, 26.000000);
  141. PlayerTextDrawAlignment(playerid, GrebGreb[playerid][10], 1);
  142. PlayerTextDrawColor(playerid, GrebGreb[playerid][10], -1);
  143. PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][10], 0);
  144. PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][10], 255);
  145. PlayerTextDrawFont(playerid, GrebGreb[playerid][10], 4);
  146. PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][10], 0);
  147. PlayerTextDrawSetSelectable(playerid, GrebGreb[playerid][10], true);
  148.  
  149. GrebGreb[playerid][11] = CreatePlayerTextDraw(playerid, 123.285804, 272.806640, "ld_pool:ball");
  150. PlayerTextDrawTextSize(playerid, GrebGreb[playerid][11], 24.000000, 26.000000);
  151. PlayerTextDrawAlignment(playerid, GrebGreb[playerid][11], 1);
  152. PlayerTextDrawColor(playerid, GrebGreb[playerid][11], -1);
  153. PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][11], 0);
  154. PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][11], 255);
  155. PlayerTextDrawFont(playerid, GrebGreb[playerid][11], 4);
  156. PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][11], 0);
  157. PlayerTextDrawSetSelectable(playerid, GrebGreb[playerid][11], true);
  158.  
  159. GrebGreb[playerid][12] = CreatePlayerTextDraw(playerid, 53.952369, 192.973327, "LD_SPAC:white");
  160. PlayerTextDrawTextSize(playerid, GrebGreb[playerid][12], 198.000000, 2.000000);
  161. PlayerTextDrawAlignment(playerid, GrebGreb[playerid][12], 1);
  162. PlayerTextDrawColor(playerid, GrebGreb[playerid][12], 16711935);
  163. PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][12], 0);
  164. PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][12], 255);
  165. PlayerTextDrawFont(playerid, GrebGreb[playerid][12], 4);
  166. PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][12], 0);
  167.  
  168. GrebGreb[playerid][13] = CreatePlayerTextDraw(playerid, 57.380935, 197.666656, "LD_SPAC:white");
  169. PlayerTextDrawTextSize(playerid, GrebGreb[playerid][13], 198.000000, 2.000000);
  170. PlayerTextDrawAlignment(playerid, GrebGreb[playerid][13], 1);
  171. PlayerTextDrawColor(playerid, GrebGreb[playerid][13], 16711935);
  172. PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][13], 0);
  173. PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][13], 255);
  174. PlayerTextDrawFont(playerid, GrebGreb[playerid][13], 4);
  175. PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][13], 0);
  176.  
  177. GrebGreb[playerid][14] = CreatePlayerTextDraw(playerid, 52.428565, 309.453277, "LD_SPAC:white");
  178. PlayerTextDrawTextSize(playerid, GrebGreb[playerid][14], 198.000000, 2.000000);
  179. PlayerTextDrawAlignment(playerid, GrebGreb[playerid][14], 1);
  180. PlayerTextDrawColor(playerid, GrebGreb[playerid][14], 16711935);
  181. PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][14], 0);
  182. PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][14], 255);
  183. PlayerTextDrawFont(playerid, GrebGreb[playerid][14], 4);
  184. PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][14], 0);
  185.  
  186. GrebGreb[playerid][15] = CreatePlayerTextDraw(playerid, 55.857135, 313.293273, "LD_SPAC:white");
  187. PlayerTextDrawTextSize(playerid, GrebGreb[playerid][15], 198.000000, 2.000000);
  188. PlayerTextDrawAlignment(playerid, GrebGreb[playerid][15], 1);
  189. PlayerTextDrawColor(playerid, GrebGreb[playerid][15], 16711935);
  190. PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][15], 0);
  191. PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][15], 255);
  192. PlayerTextDrawFont(playerid, GrebGreb[playerid][15], 4);
  193. PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][15], 0);
  194.  
  195. GrebGreb[playerid][16] = CreatePlayerTextDraw(playerid, 53.571418, 317.986602, "LD_SPAC:white");
  196. PlayerTextDrawTextSize(playerid, GrebGreb[playerid][16], 198.000000, 2.000000);
  197. PlayerTextDrawAlignment(playerid, GrebGreb[playerid][16], 1);
  198. PlayerTextDrawColor(playerid, GrebGreb[playerid][16], 16711935);
  199. PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][16], 0);
  200. PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][16], 255);
  201. PlayerTextDrawFont(playerid, GrebGreb[playerid][16], 4);
  202. PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][16], 0);
  203.  
  204. GrebGreb[playerid][17] = CreatePlayerTextDraw(playerid, 56.238079, 322.679931, "LD_SPAC:white");
  205. PlayerTextDrawTextSize(playerid, GrebGreb[playerid][17], 198.000000, 2.000000);
  206. PlayerTextDrawAlignment(playerid, GrebGreb[playerid][17], 1);
  207. PlayerTextDrawColor(playerid, GrebGreb[playerid][17], 16711935);
  208. PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][17], 0);
  209. PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][17], 255);
  210. PlayerTextDrawFont(playerid, GrebGreb[playerid][17], 4);
  211. PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][17], 0);
  212.  
  213. GrebGreb[playerid][18] = CreatePlayerTextDraw(playerid, 158.571441, 236.506622, "Dobijte_tri_ista_simbola~n~dijagonalno_vodoravno~n~ili_horizontalno_i_osvojite~n~nagradu._");
  214. PlayerTextDrawLetterSize(playerid, GrebGreb[playerid][18], 0.232000, 1.024000);
  215. PlayerTextDrawAlignment(playerid, GrebGreb[playerid][18], 1);
  216. PlayerTextDrawColor(playerid, GrebGreb[playerid][18], -1);
  217. PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][18], 0);
  218. PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][18], 255);
  219. PlayerTextDrawFont(playerid, GrebGreb[playerid][18], 1);
  220. PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][18], 1);
  221.  
  222. GrebGreb[playerid][19] = CreatePlayerTextDraw(playerid, 249.238082, 171.226684, "X");
  223. PlayerTextDrawLetterSize(playerid, GrebGreb[playerid][19], 0.383999, 1.083733);
  224. PlayerTextDrawAlignment(playerid, GrebGreb[playerid][19], 1);
  225. PlayerTextDrawColor(playerid, GrebGreb[playerid][19], -16776961);
  226. PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][19], 0);
  227. PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][19], 255);
  228. PlayerTextDrawFont(playerid, GrebGreb[playerid][19], 1);
  229. PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][19], 1);
  230. PlayerTextDrawSetSelectable(playerid, GrebGreb[playerid][19], true);
  231. return 1;
  232. }
  233.  
  234. public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
  235. {
  236. new string[500];
  237.  
  238. if(playertextid == GrebGreb[playerid][21]) {
  239. SendClientMessage(playerid, -1, "Uspjesno ste zatvorili Greb Greb!");
  240. _grebClose(playerid);
  241. }
  242.  
  243.  
  244. // =============================================== //
  245. else if(playertextid == GrebGreb[playerid][3]) {
  246. if( _grebgreb[playerid][0][0] < 1 ) {
  247.  
  248. _updateGrebGreb(playerid, 3, 0, 0);
  249. if(_grebDone(playerid)) { SetTimerEx("_grebAward", 3000, false, "d", playerid); CancelSelectTextDraw(playerid); }
  250. }
  251. }
  252. // =============================================== //
  253. else if(playertextid == GrebGreb[playerid][4]) {
  254. if( _grebgreb[playerid][1][0] < 1 ) {
  255.  
  256. _updateGrebGreb(playerid, 4, 1, 0);
  257. if(_grebDone(playerid)) { SetTimerEx("_grebAward", 3000, false, "d", playerid); CancelSelectTextDraw(playerid); }
  258. }
  259. }
  260. // =============================================== //
  261. else if(playertextid == GrebGreb[playerid][5]) {
  262. if( _grebgreb[playerid][2][0] < 1 ) {
  263.  
  264. _updateGrebGreb(playerid, 5, 2, 0);
  265. if(_grebDone(playerid)) { SetTimerEx("_grebAward", 3000, false, "d", playerid); CancelSelectTextDraw(playerid); }
  266. }
  267. }
  268. // =============================================== //
  269. else if(playertextid == GrebGreb[playerid][6]) {
  270. if( _grebgreb[playerid][0][1] < 1 ) {
  271.  
  272. _updateGrebGreb(playerid, 6, 0, 1);
  273. if(_grebDone(playerid)) { SetTimerEx("_grebAward", 3000, false, "d", playerid); CancelSelectTextDraw(playerid); }
  274. }
  275. }
  276. // =============================================== //
  277. else if(playertextid == GrebGreb[playerid][7]) {
  278. if( _grebgreb[playerid][1][1] < 1 ) {
  279.  
  280. _updateGrebGreb(playerid, 7, 1, 1);
  281. if(_grebDone(playerid)) { SetTimerEx("_grebAward", 3000, false, "d", playerid); CancelSelectTextDraw(playerid); }
  282. }
  283. }
  284. // =============================================== //
  285. else if(playertextid == GrebGreb[playerid][8]) {
  286. if( _grebgreb[playerid][2][1] < 1 ) {
  287.  
  288. _updateGrebGreb(playerid, 8, 2, 1);
  289. if(_grebDone(playerid)) { SetTimerEx("_grebAward", 3000, false, "d", playerid); CancelSelectTextDraw(playerid); }
  290. }
  291. }
  292. // =============================================== //
  293. else if(playertextid == GrebGreb[playerid][9]) {
  294. if( _grebgreb[playerid][0][2] < 1 ) {
  295.  
  296. _updateGrebGreb(playerid, 9, 0, 2);
  297. if(_grebDone(playerid)) { SetTimerEx("_grebAward", 3000, false, "d", playerid); CancelSelectTextDraw(playerid); }
  298. }
  299. }
  300. // =============================================== //
  301. else if(playertextid == GrebGreb[playerid][10]) {
  302. if( _grebgreb[playerid][1][2] < 1 ) {
  303.  
  304. _updateGrebGreb(playerid, 10, 1, 2);
  305. if(_grebDone(playerid)) { SetTimerEx("_grebAward", 3000, false, "d", playerid); CancelSelectTextDraw(playerid); }
  306. }
  307. }
  308. // =============================================== //
  309. else if(playertextid == GrebGreb[playerid][11]) {
  310. if( _grebgreb[playerid][2][2] < 1 ) {
  311.  
  312. _updateGrebGreb(playerid, 11, 2, 2);
  313. if(_grebDone(playerid)) { SetTimerEx("_grebAward", 3000, false, "d", playerid); CancelSelectTextDraw(playerid); }
  314.  
  315. }
  316. }
  317. return 1;
  318. }
  319.  
  320. // Commands
  321.  
  322. CMD:grebgreb(playerid) {
  323.  
  324.  
  325. if(_grebActive[playerid] == true) return SendClientMessage(playerid, -1, "Vec grebes GrebGreb srecku!");
  326.  
  327. _grebActive[playerid] = true;
  328. SelectTextDraw(playerid, 0xA3B4C5FF);
  329. for(new i=0; i<sizeof(GrebGreb); i++) {
  330. PlayerTextDrawShow(playerid, GrebGreb[playerid][i]);
  331. }
  332. return 1;
  333. }
  334.  
  335. // Functions
  336.  
  337. forward var_reset(playerid);
  338. public var_reset(playerid) {
  339.  
  340. for(new i = 0; i < 3; i++) {
  341. for(new j = 0; j < 3; j++) {
  342. _grebgreb[playerid][i][j] = 0;
  343. }
  344. }
  345. _grebActive[playerid] = false;
  346.  
  347. return 1;
  348. }
  349.  
  350.  
  351. forward _updateGrebGreb(playerid, id, i, j);
  352. public _updateGrebGreb(playerid, id, i, j){
  353.  
  354. new _tayloRM = random(6)+1;
  355.  
  356. switch(tayloRM) {
  357. case 1: { PlayerTextDrawSetString(playerid, GrebGreb[playerid][id], "ld_none:ship3"); _grebgreb[playerid][i][j] = 1; }
  358. case 2: { PlayerTextDrawSetString(playerid, GrebGreb[playerid][id], "ld_none:ship3"); _grebgreb[playerid][i][j] = 1; }
  359. case 3: { PlayerTextDrawSetString(playerid, GrebGreb[playerid][id], "ld_none:ship2"); _grebgreb[playerid][i][j] = 2; }
  360. case 4: { PlayerTextDrawSetString(playerid, GrebGreb[playerid][id], "ld_none:ship2"); _grebgreb[playerid][i][j] = 2; }
  361. case 5: { PlayerTextDrawSetString(playerid, GrebGreb[playerid][id], "ld_none:ship"); _grebgreb[playerid][i][j] = 3; }
  362. case 6: { PlayerTextDrawSetString(playerid, GrebGreb[playerid][id], "ld_none:ship"); _grebgreb[playerid][i][j] = 3; }
  363. case 7: { PlayerTextDrawSetString(playerid, GrebGreb[playerid][id], "ld_none:ship3"); _grebgreb[playerid][i][j] = 1; }
  364. }
  365. return 1;
  366. }
  367.  
  368. forward _grebDone(playerid);
  369. public _grebDone(playerid) {
  370.  
  371. for(new i = 0; i < 3; i++) {
  372. for(new j = 0; j < 3; j++) {
  373. if(_grebgreb[playerid][i][j] == 0) return 0;
  374. }
  375. }
  376.  
  377. return 1;
  378. }
  379.  
  380. forward _grebAward(playerid);
  381. public _grebAward(playerid) {
  382.  
  383. new string[400] = ""COL_SERVER">> STATUS GREB-GREBA:\n\n{FFFFFF}";
  384.  
  385.  
  386. new award=0;
  387. if(_grebgreb[playerid][0][0] == _grebgreb[playerid][0][1] && _grebgreb[playerid][0][1] == _grebgreb[playerid][0][2]) {
  388. strcat(string, "Prvi red vam je isti i dobili ste 50.000$!\n");
  389. award++;
  390. }
  391.  
  392. if(_grebgreb[playerid][1][0] == _grebgreb[playerid][1][1] && _grebgreb[playerid][1][1] == _grebgreb[playerid][1][2]) {
  393. strcat(string, "Drugi red vam je isti i dobili ste 50.000$!\n");
  394. award++;
  395. }
  396.  
  397. if(_grebgreb[playerid][2][0] == _grebgreb[playerid][2][1] && _grebgreb[playerid][2][1] == _grebgreb[playerid][2][2]) {
  398. strcat(string, "Treci red vam je isti i dobili ste 50.000$!\n");
  399. award++;
  400. }
  401.  
  402. if(_grebgreb[playerid][0][0] == _grebgreb[playerid][1][0] && _grebgreb[playerid][1][0] == _grebgreb[playerid][2][0]) {
  403. strcat(string, "Prva kolona vam je ista i dobili ste 50.000$!\n");
  404. award++;
  405. }
  406.  
  407. if(_grebgreb[playerid][0][1] == _grebgreb[playerid][1][1] && _grebgreb[playerid][1][1] == _grebgreb[playerid][2][1]) {
  408. strcat(string, "Druga kolona vam je ista i dobili ste 50.000$!\n");
  409. award++;
  410. }
  411.  
  412. if(_grebgreb[playerid][0][2] == _grebgreb[playerid][1][2] && _grebgreb[playerid][1][2] == _grebgreb[playerid][2][2]) {
  413. strcat(string, "Treca kolona vam je ista i dobili ste 50.000$!\n");
  414. award++;
  415. }
  416.  
  417. if(_grebgreb[playerid][0][0] == _grebgreb[playerid][1][1] && _grebgreb[playerid][1][1] == _grebgreb[playerid][2][2]) {
  418. strcat(string, "Glavna dijagonala vam je ista i dobili ste 50.000$!\n");
  419. award++;
  420. }
  421.  
  422. if(_grebgreb[playerid][0][2] == _grebgreb[playerid][1][1] && _grebgreb[playerid][1][1] == _grebgreb[playerid][2][0]) {
  423. strcat(string, "Sporedna dijagonala vam je ista i dobili ste 50.000$!\n");
  424. award++;
  425. }
  426. if( award == 0 ) strcat(string, "Niste nista osvojili!");
  427. else {
  428. new nesto[50];
  429. format(nesto,sizeof nesto , "\n\nUkupni dobitak: "COL_RED"%d$!", award*50000);
  430. strcat(string, nesto);
  431. GivePlayerMoney(playerid, award*50000);
  432. }
  433.  
  434.  
  435. ShowPlayerDialog(playerid, DIALOG_GREBGREB, DIALOG_STYLE_MSGBOX, "GREBGREB", string, "Uredu", "");
  436.  
  437. _grebClose(playerid);
  438.  
  439. return 1;
  440. }
  441.  
  442. forward _grebClose(playerid);
  443. public _grebClose(playerid){
  444.  
  445. _grebActive[playerid] = false;
  446. for(new i = 0; i < 3; i++) {
  447. for(new j = 0; j < 3; j++) {
  448. _grebgreb[playerid][i][j] = 0;
  449. }
  450. }
  451.  
  452. TogglePlayerControllable(playerid, 1);
  453. CancelSelectTextDraw(playerid); // canceluje
  454. for(new i=3; i<12; i++) PlayerTextDrawSetString(playerid, GrebGreb[playerid][i], "ld_pool:ball"); // reset
  455. for(new i=0; i<sizeof(GrebGreb); i++) PlayerTextDrawHide(playerid, GrebGreb[playerid][i]); // mice ih
  456. return 1;
  457. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement