Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ========================================================================== //
- /*
- F I L T E R S C R I P T
- grebgreb sreckice
- @AUTHOR: tayloR
- */
- // ========================================================================== //
- // Includes
- #include <a_samp>
- #include <YSI/y_commands>
- // Player variable
- new _grebgreb[MAX_PLAYERS][3][3];
- new bool:_grebActive[MAX_PLAYERS];
- // Player textdraw
- new PlayerText:GrebGreb[MAX_PLAYERS][20];
- // Dialog ID
- #define DIALOG_GREBGREB 1
- public OnFilterScriptInit() {
- return 1;
- }
- public OnFilterScriptExit() {
- return 1;
- }
- public OnPlayerDisconnect(playerid) {
- var_reset(playerid);
- return 1;
- }
- public OnPlayerConnect(playerid) {
- GrebGreb[playerid][0] = CreatePlayerTextDraw(playerid, 52.047660, 172.493316, "LD_SPAC:white");
- PlayerTextDrawTextSize(playerid, GrebGreb[playerid][0], 206.000000, 155.000000);
- PlayerTextDrawAlignment(playerid, GrebGreb[playerid][0], 1);
- PlayerTextDrawColor(playerid, GrebGreb[playerid][0], 255);
- PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][0], 0);
- PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][0], 255);
- PlayerTextDrawFont(playerid, GrebGreb[playerid][0], 4);
- PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][0], 0);
- GrebGreb[playerid][1] = CreatePlayerTextDraw(playerid, 56.238136, 204.919952, "LD_SPAC:white");
- PlayerTextDrawTextSize(playerid, GrebGreb[playerid][1], 99.000000, 101.000000);
- PlayerTextDrawAlignment(playerid, GrebGreb[playerid][1], 1);
- PlayerTextDrawColor(playerid, GrebGreb[playerid][1], 16711935);
- PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][1], 0);
- PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][1], 255);
- PlayerTextDrawFont(playerid, GrebGreb[playerid][1], 4);
- PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][1], 0);
- GrebGreb[playerid][2] = CreatePlayerTextDraw(playerid, 120.476173, 177.626678, "GREB-GREB");
- PlayerTextDrawLetterSize(playerid, GrebGreb[playerid][2], 0.400000, 1.600000);
- PlayerTextDrawAlignment(playerid, GrebGreb[playerid][2], 1);
- PlayerTextDrawColor(playerid, GrebGreb[playerid][2], 16711935);
- PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][2], 0);
- PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][2], 255);
- PlayerTextDrawFont(playerid, GrebGreb[playerid][2], 1);
- PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][2], 1);
- GrebGreb[playerid][3] = CreatePlayerTextDraw(playerid, 60.428623, 215.159942, "ld_pool:ball");
- PlayerTextDrawTextSize(playerid, GrebGreb[playerid][3], 24.000000, 26.000000);
- PlayerTextDrawAlignment(playerid, GrebGreb[playerid][3], 1);
- PlayerTextDrawColor(playerid, GrebGreb[playerid][3], -1);
- PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][3], 0);
- PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][3], 255);
- PlayerTextDrawFont(playerid, GrebGreb[playerid][3], 4);
- PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][3], 0);
- PlayerTextDrawSetSelectable(playerid, GrebGreb[playerid][3], true);
- GrebGreb[playerid][4] = CreatePlayerTextDraw(playerid, 60.809574, 243.319915, "ld_pool:ball");
- PlayerTextDrawTextSize(playerid, GrebGreb[playerid][4], 24.000000, 26.000000);
- PlayerTextDrawAlignment(playerid, GrebGreb[playerid][4], 1);
- PlayerTextDrawColor(playerid, GrebGreb[playerid][4], -1);
- PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][4], 0);
- PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][4], 255);
- PlayerTextDrawFont(playerid, GrebGreb[playerid][4], 4);
- PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][4], 0);
- PlayerTextDrawSetSelectable(playerid, GrebGreb[playerid][4], true);
- GrebGreb[playerid][5] = CreatePlayerTextDraw(playerid, 61.190525, 271.906555, "ld_pool:ball");
- PlayerTextDrawTextSize(playerid, GrebGreb[playerid][5], 24.000000, 26.000000);
- PlayerTextDrawAlignment(playerid, GrebGreb[playerid][5], 1);
- PlayerTextDrawColor(playerid, GrebGreb[playerid][5], -1);
- PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][5], 0);
- PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][5], 255);
- PlayerTextDrawFont(playerid, GrebGreb[playerid][5], 4);
- PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][5], 0);
- PlayerTextDrawSetSelectable(playerid, GrebGreb[playerid][5], true);
- GrebGreb[playerid][6] = CreatePlayerTextDraw(playerid, 91.285789, 214.306625, "ld_pool:ball");
- PlayerTextDrawTextSize(playerid, GrebGreb[playerid][6], 24.000000, 26.000000);
- PlayerTextDrawAlignment(playerid, GrebGreb[playerid][6], 1);
- PlayerTextDrawColor(playerid, GrebGreb[playerid][6], -1);
- PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][6], 0);
- PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][6], 255);
- PlayerTextDrawFont(playerid, GrebGreb[playerid][6], 4);
- PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][6], 0);
- PlayerTextDrawSetSelectable(playerid, GrebGreb[playerid][6], true);
- GrebGreb[playerid][7] = CreatePlayerTextDraw(playerid, 91.666740, 243.319931, "ld_pool:ball");
- PlayerTextDrawTextSize(playerid, GrebGreb[playerid][7], 24.000000, 26.000000);
- PlayerTextDrawAlignment(playerid, GrebGreb[playerid][7], 1);
- PlayerTextDrawColor(playerid, GrebGreb[playerid][7], -1);
- PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][7], 0);
- PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][7], 255);
- PlayerTextDrawFont(playerid, GrebGreb[playerid][7], 4);
- PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][7], 0);
- PlayerTextDrawSetSelectable(playerid, GrebGreb[playerid][7], true);
- GrebGreb[playerid][8] = CreatePlayerTextDraw(playerid, 92.047698, 272.333251, "ld_pool:ball");
- PlayerTextDrawTextSize(playerid, GrebGreb[playerid][8], 24.000000, 26.000000);
- PlayerTextDrawAlignment(playerid, GrebGreb[playerid][8], 1);
- PlayerTextDrawColor(playerid, GrebGreb[playerid][8], -1);
- PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][8], 0);
- PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][8], 255);
- PlayerTextDrawFont(playerid, GrebGreb[playerid][8], 4);
- PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][8], 0);
- PlayerTextDrawSetSelectable(playerid, GrebGreb[playerid][8], true);
- GrebGreb[playerid][9] = CreatePlayerTextDraw(playerid, 123.285797, 214.733306, "ld_pool:ball");
- PlayerTextDrawTextSize(playerid, GrebGreb[playerid][9], 24.000000, 26.000000);
- PlayerTextDrawAlignment(playerid, GrebGreb[playerid][9], 1);
- PlayerTextDrawColor(playerid, GrebGreb[playerid][9], -1);
- PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][9], 0);
- PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][9], 255);
- PlayerTextDrawFont(playerid, GrebGreb[playerid][9], 4);
- PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][9], 0);
- PlayerTextDrawSetSelectable(playerid, GrebGreb[playerid][9], true);
- GrebGreb[playerid][10] = CreatePlayerTextDraw(playerid, 123.285812, 243.746612, "ld_pool:ball");
- PlayerTextDrawTextSize(playerid, GrebGreb[playerid][10], 24.000000, 26.000000);
- PlayerTextDrawAlignment(playerid, GrebGreb[playerid][10], 1);
- PlayerTextDrawColor(playerid, GrebGreb[playerid][10], -1);
- PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][10], 0);
- PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][10], 255);
- PlayerTextDrawFont(playerid, GrebGreb[playerid][10], 4);
- PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][10], 0);
- PlayerTextDrawSetSelectable(playerid, GrebGreb[playerid][10], true);
- GrebGreb[playerid][11] = CreatePlayerTextDraw(playerid, 123.285804, 272.806640, "ld_pool:ball");
- PlayerTextDrawTextSize(playerid, GrebGreb[playerid][11], 24.000000, 26.000000);
- PlayerTextDrawAlignment(playerid, GrebGreb[playerid][11], 1);
- PlayerTextDrawColor(playerid, GrebGreb[playerid][11], -1);
- PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][11], 0);
- PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][11], 255);
- PlayerTextDrawFont(playerid, GrebGreb[playerid][11], 4);
- PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][11], 0);
- PlayerTextDrawSetSelectable(playerid, GrebGreb[playerid][11], true);
- GrebGreb[playerid][12] = CreatePlayerTextDraw(playerid, 53.952369, 192.973327, "LD_SPAC:white");
- PlayerTextDrawTextSize(playerid, GrebGreb[playerid][12], 198.000000, 2.000000);
- PlayerTextDrawAlignment(playerid, GrebGreb[playerid][12], 1);
- PlayerTextDrawColor(playerid, GrebGreb[playerid][12], 16711935);
- PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][12], 0);
- PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][12], 255);
- PlayerTextDrawFont(playerid, GrebGreb[playerid][12], 4);
- PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][12], 0);
- GrebGreb[playerid][13] = CreatePlayerTextDraw(playerid, 57.380935, 197.666656, "LD_SPAC:white");
- PlayerTextDrawTextSize(playerid, GrebGreb[playerid][13], 198.000000, 2.000000);
- PlayerTextDrawAlignment(playerid, GrebGreb[playerid][13], 1);
- PlayerTextDrawColor(playerid, GrebGreb[playerid][13], 16711935);
- PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][13], 0);
- PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][13], 255);
- PlayerTextDrawFont(playerid, GrebGreb[playerid][13], 4);
- PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][13], 0);
- GrebGreb[playerid][14] = CreatePlayerTextDraw(playerid, 52.428565, 309.453277, "LD_SPAC:white");
- PlayerTextDrawTextSize(playerid, GrebGreb[playerid][14], 198.000000, 2.000000);
- PlayerTextDrawAlignment(playerid, GrebGreb[playerid][14], 1);
- PlayerTextDrawColor(playerid, GrebGreb[playerid][14], 16711935);
- PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][14], 0);
- PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][14], 255);
- PlayerTextDrawFont(playerid, GrebGreb[playerid][14], 4);
- PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][14], 0);
- GrebGreb[playerid][15] = CreatePlayerTextDraw(playerid, 55.857135, 313.293273, "LD_SPAC:white");
- PlayerTextDrawTextSize(playerid, GrebGreb[playerid][15], 198.000000, 2.000000);
- PlayerTextDrawAlignment(playerid, GrebGreb[playerid][15], 1);
- PlayerTextDrawColor(playerid, GrebGreb[playerid][15], 16711935);
- PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][15], 0);
- PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][15], 255);
- PlayerTextDrawFont(playerid, GrebGreb[playerid][15], 4);
- PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][15], 0);
- GrebGreb[playerid][16] = CreatePlayerTextDraw(playerid, 53.571418, 317.986602, "LD_SPAC:white");
- PlayerTextDrawTextSize(playerid, GrebGreb[playerid][16], 198.000000, 2.000000);
- PlayerTextDrawAlignment(playerid, GrebGreb[playerid][16], 1);
- PlayerTextDrawColor(playerid, GrebGreb[playerid][16], 16711935);
- PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][16], 0);
- PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][16], 255);
- PlayerTextDrawFont(playerid, GrebGreb[playerid][16], 4);
- PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][16], 0);
- GrebGreb[playerid][17] = CreatePlayerTextDraw(playerid, 56.238079, 322.679931, "LD_SPAC:white");
- PlayerTextDrawTextSize(playerid, GrebGreb[playerid][17], 198.000000, 2.000000);
- PlayerTextDrawAlignment(playerid, GrebGreb[playerid][17], 1);
- PlayerTextDrawColor(playerid, GrebGreb[playerid][17], 16711935);
- PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][17], 0);
- PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][17], 255);
- PlayerTextDrawFont(playerid, GrebGreb[playerid][17], 4);
- PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][17], 0);
- GrebGreb[playerid][18] = CreatePlayerTextDraw(playerid, 158.571441, 236.506622, "Dobijte_tri_ista_simbola~n~dijagonalno_vodoravno~n~ili_horizontalno_i_osvojite~n~nagradu._");
- PlayerTextDrawLetterSize(playerid, GrebGreb[playerid][18], 0.232000, 1.024000);
- PlayerTextDrawAlignment(playerid, GrebGreb[playerid][18], 1);
- PlayerTextDrawColor(playerid, GrebGreb[playerid][18], -1);
- PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][18], 0);
- PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][18], 255);
- PlayerTextDrawFont(playerid, GrebGreb[playerid][18], 1);
- PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][18], 1);
- GrebGreb[playerid][19] = CreatePlayerTextDraw(playerid, 249.238082, 171.226684, "X");
- PlayerTextDrawLetterSize(playerid, GrebGreb[playerid][19], 0.383999, 1.083733);
- PlayerTextDrawAlignment(playerid, GrebGreb[playerid][19], 1);
- PlayerTextDrawColor(playerid, GrebGreb[playerid][19], -16776961);
- PlayerTextDrawSetShadow(playerid, GrebGreb[playerid][19], 0);
- PlayerTextDrawBackgroundColor(playerid, GrebGreb[playerid][19], 255);
- PlayerTextDrawFont(playerid, GrebGreb[playerid][19], 1);
- PlayerTextDrawSetProportional(playerid, GrebGreb[playerid][19], 1);
- PlayerTextDrawSetSelectable(playerid, GrebGreb[playerid][19], true);
- return 1;
- }
- public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
- {
- new string[500];
- if(playertextid == GrebGreb[playerid][21]) {
- SendClientMessage(playerid, -1, "Uspjesno ste zatvorili Greb Greb!");
- _grebClose(playerid);
- }
- // =============================================== //
- else if(playertextid == GrebGreb[playerid][3]) {
- if( _grebgreb[playerid][0][0] < 1 ) {
- _updateGrebGreb(playerid, 3, 0, 0);
- if(_grebDone(playerid)) { SetTimerEx("_grebAward", 3000, false, "d", playerid); CancelSelectTextDraw(playerid); }
- }
- }
- // =============================================== //
- else if(playertextid == GrebGreb[playerid][4]) {
- if( _grebgreb[playerid][1][0] < 1 ) {
- _updateGrebGreb(playerid, 4, 1, 0);
- if(_grebDone(playerid)) { SetTimerEx("_grebAward", 3000, false, "d", playerid); CancelSelectTextDraw(playerid); }
- }
- }
- // =============================================== //
- else if(playertextid == GrebGreb[playerid][5]) {
- if( _grebgreb[playerid][2][0] < 1 ) {
- _updateGrebGreb(playerid, 5, 2, 0);
- if(_grebDone(playerid)) { SetTimerEx("_grebAward", 3000, false, "d", playerid); CancelSelectTextDraw(playerid); }
- }
- }
- // =============================================== //
- else if(playertextid == GrebGreb[playerid][6]) {
- if( _grebgreb[playerid][0][1] < 1 ) {
- _updateGrebGreb(playerid, 6, 0, 1);
- if(_grebDone(playerid)) { SetTimerEx("_grebAward", 3000, false, "d", playerid); CancelSelectTextDraw(playerid); }
- }
- }
- // =============================================== //
- else if(playertextid == GrebGreb[playerid][7]) {
- if( _grebgreb[playerid][1][1] < 1 ) {
- _updateGrebGreb(playerid, 7, 1, 1);
- if(_grebDone(playerid)) { SetTimerEx("_grebAward", 3000, false, "d", playerid); CancelSelectTextDraw(playerid); }
- }
- }
- // =============================================== //
- else if(playertextid == GrebGreb[playerid][8]) {
- if( _grebgreb[playerid][2][1] < 1 ) {
- _updateGrebGreb(playerid, 8, 2, 1);
- if(_grebDone(playerid)) { SetTimerEx("_grebAward", 3000, false, "d", playerid); CancelSelectTextDraw(playerid); }
- }
- }
- // =============================================== //
- else if(playertextid == GrebGreb[playerid][9]) {
- if( _grebgreb[playerid][0][2] < 1 ) {
- _updateGrebGreb(playerid, 9, 0, 2);
- if(_grebDone(playerid)) { SetTimerEx("_grebAward", 3000, false, "d", playerid); CancelSelectTextDraw(playerid); }
- }
- }
- // =============================================== //
- else if(playertextid == GrebGreb[playerid][10]) {
- if( _grebgreb[playerid][1][2] < 1 ) {
- _updateGrebGreb(playerid, 10, 1, 2);
- if(_grebDone(playerid)) { SetTimerEx("_grebAward", 3000, false, "d", playerid); CancelSelectTextDraw(playerid); }
- }
- }
- // =============================================== //
- else if(playertextid == GrebGreb[playerid][11]) {
- if( _grebgreb[playerid][2][2] < 1 ) {
- _updateGrebGreb(playerid, 11, 2, 2);
- if(_grebDone(playerid)) { SetTimerEx("_grebAward", 3000, false, "d", playerid); CancelSelectTextDraw(playerid); }
- }
- }
- return 1;
- }
- // Commands
- CMD:grebgreb(playerid) {
- if(_grebActive[playerid] == true) return SendClientMessage(playerid, -1, "Vec grebes GrebGreb srecku!");
- _grebActive[playerid] = true;
- SelectTextDraw(playerid, 0xA3B4C5FF);
- for(new i=0; i<sizeof(GrebGreb); i++) {
- PlayerTextDrawShow(playerid, GrebGreb[playerid][i]);
- }
- return 1;
- }
- // Functions
- forward var_reset(playerid);
- public var_reset(playerid) {
- for(new i = 0; i < 3; i++) {
- for(new j = 0; j < 3; j++) {
- _grebgreb[playerid][i][j] = 0;
- }
- }
- _grebActive[playerid] = false;
- return 1;
- }
- forward _updateGrebGreb(playerid, id, i, j);
- public _updateGrebGreb(playerid, id, i, j){
- new _tayloRM = random(6)+1;
- switch(tayloRM) {
- case 1: { PlayerTextDrawSetString(playerid, GrebGreb[playerid][id], "ld_none:ship3"); _grebgreb[playerid][i][j] = 1; }
- case 2: { PlayerTextDrawSetString(playerid, GrebGreb[playerid][id], "ld_none:ship3"); _grebgreb[playerid][i][j] = 1; }
- case 3: { PlayerTextDrawSetString(playerid, GrebGreb[playerid][id], "ld_none:ship2"); _grebgreb[playerid][i][j] = 2; }
- case 4: { PlayerTextDrawSetString(playerid, GrebGreb[playerid][id], "ld_none:ship2"); _grebgreb[playerid][i][j] = 2; }
- case 5: { PlayerTextDrawSetString(playerid, GrebGreb[playerid][id], "ld_none:ship"); _grebgreb[playerid][i][j] = 3; }
- case 6: { PlayerTextDrawSetString(playerid, GrebGreb[playerid][id], "ld_none:ship"); _grebgreb[playerid][i][j] = 3; }
- case 7: { PlayerTextDrawSetString(playerid, GrebGreb[playerid][id], "ld_none:ship3"); _grebgreb[playerid][i][j] = 1; }
- }
- return 1;
- }
- forward _grebDone(playerid);
- public _grebDone(playerid) {
- for(new i = 0; i < 3; i++) {
- for(new j = 0; j < 3; j++) {
- if(_grebgreb[playerid][i][j] == 0) return 0;
- }
- }
- return 1;
- }
- forward _grebAward(playerid);
- public _grebAward(playerid) {
- new string[400] = ""COL_SERVER">> STATUS GREB-GREBA:\n\n{FFFFFF}";
- new award=0;
- if(_grebgreb[playerid][0][0] == _grebgreb[playerid][0][1] && _grebgreb[playerid][0][1] == _grebgreb[playerid][0][2]) {
- strcat(string, "Prvi red vam je isti i dobili ste 50.000$!\n");
- award++;
- }
- if(_grebgreb[playerid][1][0] == _grebgreb[playerid][1][1] && _grebgreb[playerid][1][1] == _grebgreb[playerid][1][2]) {
- strcat(string, "Drugi red vam je isti i dobili ste 50.000$!\n");
- award++;
- }
- if(_grebgreb[playerid][2][0] == _grebgreb[playerid][2][1] && _grebgreb[playerid][2][1] == _grebgreb[playerid][2][2]) {
- strcat(string, "Treci red vam je isti i dobili ste 50.000$!\n");
- award++;
- }
- if(_grebgreb[playerid][0][0] == _grebgreb[playerid][1][0] && _grebgreb[playerid][1][0] == _grebgreb[playerid][2][0]) {
- strcat(string, "Prva kolona vam je ista i dobili ste 50.000$!\n");
- award++;
- }
- if(_grebgreb[playerid][0][1] == _grebgreb[playerid][1][1] && _grebgreb[playerid][1][1] == _grebgreb[playerid][2][1]) {
- strcat(string, "Druga kolona vam je ista i dobili ste 50.000$!\n");
- award++;
- }
- if(_grebgreb[playerid][0][2] == _grebgreb[playerid][1][2] && _grebgreb[playerid][1][2] == _grebgreb[playerid][2][2]) {
- strcat(string, "Treca kolona vam je ista i dobili ste 50.000$!\n");
- award++;
- }
- if(_grebgreb[playerid][0][0] == _grebgreb[playerid][1][1] && _grebgreb[playerid][1][1] == _grebgreb[playerid][2][2]) {
- strcat(string, "Glavna dijagonala vam je ista i dobili ste 50.000$!\n");
- award++;
- }
- if(_grebgreb[playerid][0][2] == _grebgreb[playerid][1][1] && _grebgreb[playerid][1][1] == _grebgreb[playerid][2][0]) {
- strcat(string, "Sporedna dijagonala vam je ista i dobili ste 50.000$!\n");
- award++;
- }
- if( award == 0 ) strcat(string, "Niste nista osvojili!");
- else {
- new nesto[50];
- format(nesto,sizeof nesto , "\n\nUkupni dobitak: "COL_RED"%d$!", award*50000);
- strcat(string, nesto);
- GivePlayerMoney(playerid, award*50000);
- }
- ShowPlayerDialog(playerid, DIALOG_GREBGREB, DIALOG_STYLE_MSGBOX, "GREBGREB", string, "Uredu", "");
- _grebClose(playerid);
- return 1;
- }
- forward _grebClose(playerid);
- public _grebClose(playerid){
- _grebActive[playerid] = false;
- for(new i = 0; i < 3; i++) {
- for(new j = 0; j < 3; j++) {
- _grebgreb[playerid][i][j] = 0;
- }
- }
- TogglePlayerControllable(playerid, 1);
- CancelSelectTextDraw(playerid); // canceluje
- for(new i=3; i<12; i++) PlayerTextDrawSetString(playerid, GrebGreb[playerid][i], "ld_pool:ball"); // reset
- for(new i=0; i<sizeof(GrebGreb); i++) PlayerTextDrawHide(playerid, GrebGreb[playerid][i]); // mice ih
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement