Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Memory MiniGame FS
- Simon_Italy
- 09/2011
- Thanks:
- <zcmd> Zeex
- <TextDraw Editor> Zamaroth
- */
- #include <a_samp>
- #define FILTERSCRIPT
- #include <zcmd>
- #define COLOR_WHITE 0xFFFFFFFF
- #define COLOR_ORANGE 0xFFAF02FF
- #define COLOR_RED 0xFF0000FF
- #define MEM_TAB 4
- //------------------------------------------------------------------------------
- new Text:MemoryLine[10];
- new Text:MemoryBox[16];
- new Text:MemoryExtra[5];
- new Text:CorrectTD;
- new Text:WrongTD;
- new Text:CompletedTD;
- new Text:MemoryTimer[MAX_PLAYERS];
- new MemoryColor[MAX_PLAYERS][MEM_TAB][MEM_TAB char];
- #define MemoryColor[%0][%1][%2] MemoryColor[%0][%1]{%2}
- new MemoryVehicle[MAX_PLAYERS][MEM_TAB*MEM_TAB];
- new MemoryTime[MAX_PLAYERS];
- new BestTime = 99999;
- new PlayingMemory[MAX_PLAYERS char];
- #define PlayingMemory[%0] PlayingMemory{%0}
- new PlayerX[MAX_PLAYERS];
- new PlayerY[MAX_PLAYERS];
- new PlayerClickX[MAX_PLAYERS char];
- #define PlayerClicX[%0] PlayerClicX{%0}
- new PlayerClickY[MAX_PLAYERS char];
- #define PlayerClicY[%0] PlayerClicY{%0}
- new KeyTimer[MAX_PLAYERS];
- new ScoreTimer[MAX_PLAYERS];
- enum plps
- {
- Float:PPX,
- Float:PPY,
- Float:PPZ,
- PPInt,
- PPVW
- }
- new PlayerPos[MAX_PLAYERS][plps];
- new TDO[MEM_TAB][MEM_TAB] =
- {
- {0,1,2,3},
- {4,5,6,7},
- {8,9,10,11},
- {12,13,14,15}
- };
- new MapCover;
- forward KeyCheck(playerid);
- forward ScoreCheck(playerid);
- forward CoverMem(playerid, Text:TD1, Text:TD2);
- //------------------------------------------------------------------------------
- public OnFilterScriptInit()
- {
- new a[][] =
- {
- "Unarmed (Fist)",
- "Brass K"
- };
- #pragma unused a
- MemoryLine[0] = TextDrawCreate(246.000000, 111.000000, "_");
- TextDrawBackgroundColor(MemoryLine[0], 255);
- TextDrawFont(MemoryLine[0], 1);
- TextDrawLetterSize(MemoryLine[0], 0.500000, 29.500001);
- TextDrawColor(MemoryLine[0], -1);
- TextDrawSetOutline(MemoryLine[0], 0);
- TextDrawSetProportional(MemoryLine[0], 1);
- TextDrawSetShadow(MemoryLine[0], 1);
- TextDrawUseBox(MemoryLine[0], 1);
- TextDrawBoxColor(MemoryLine[0], -1);
- TextDrawTextSize(MemoryLine[0], 239.000000, 0.000000);
- MemoryLine[1] = TextDrawCreate(320.000000, 111.000000, "_");
- TextDrawBackgroundColor(MemoryLine[1], 255);
- TextDrawFont(MemoryLine[1], 1);
- TextDrawLetterSize(MemoryLine[1], 0.500000, 29.500001);
- TextDrawColor(MemoryLine[1], -1);
- TextDrawSetOutline(MemoryLine[1], 0);
- TextDrawSetProportional(MemoryLine[1], 1);
- TextDrawSetShadow(MemoryLine[1], 1);
- TextDrawUseBox(MemoryLine[1], 1);
- TextDrawBoxColor(MemoryLine[1], -1);
- TextDrawTextSize(MemoryLine[1], 313.000000, 0.000000);
- MemoryLine[2] = TextDrawCreate(384.000000, 111.000000, "_");
- TextDrawBackgroundColor(MemoryLine[2], 255);
- TextDrawFont(MemoryLine[2], 1);
- TextDrawLetterSize(MemoryLine[2], 0.500000, 29.500001);
- TextDrawColor(MemoryLine[2], -1);
- TextDrawSetOutline(MemoryLine[2], 0);
- TextDrawSetProportional(MemoryLine[2], 1);
- TextDrawSetShadow(MemoryLine[2], 1);
- TextDrawUseBox(MemoryLine[2], 1);
- TextDrawBoxColor(MemoryLine[2], -1);
- TextDrawTextSize(MemoryLine[2], 383.000000, 0.000000);
- MemoryLine[3] = TextDrawCreate(170.000000, 111.000000, "_");
- TextDrawBackgroundColor(MemoryLine[3], 255);
- TextDrawFont(MemoryLine[3], 1);
- TextDrawLetterSize(MemoryLine[3], 0.500000, 29.500001);
- TextDrawColor(MemoryLine[3], -1);
- TextDrawSetOutline(MemoryLine[3], 0);
- TextDrawSetProportional(MemoryLine[3], 1);
- TextDrawSetShadow(MemoryLine[3], 1);
- TextDrawUseBox(MemoryLine[3], 1);
- TextDrawBoxColor(MemoryLine[3], -1);
- TextDrawTextSize(MemoryLine[3], 169.000000, 0.000000);
- MemoryLine[4] = TextDrawCreate(454.000000, 111.000000, "_");
- TextDrawBackgroundColor(MemoryLine[4], 255);
- TextDrawFont(MemoryLine[4], 1);
- TextDrawLetterSize(MemoryLine[4], 0.500000, 29.500001);
- TextDrawColor(MemoryLine[4], -1);
- TextDrawSetOutline(MemoryLine[4], 0);
- TextDrawSetProportional(MemoryLine[4], 1);
- TextDrawSetShadow(MemoryLine[4], 1);
- TextDrawUseBox(MemoryLine[4], 1);
- TextDrawBoxColor(MemoryLine[4], -1);
- TextDrawTextSize(MemoryLine[4], 453.000000, 0.000000);
- MemoryLine[5] = TextDrawCreate(170.000000, 109.000000, "_");
- TextDrawBackgroundColor(MemoryLine[5], 255);
- TextDrawFont(MemoryLine[5], 1);
- TextDrawLetterSize(MemoryLine[5], 1.399999, -0.199999);
- TextDrawColor(MemoryLine[5], -1);
- TextDrawSetOutline(MemoryLine[5], 0);
- TextDrawSetProportional(MemoryLine[5], 1);
- TextDrawSetShadow(MemoryLine[5], 1);
- TextDrawUseBox(MemoryLine[5], 1);
- TextDrawBoxColor(MemoryLine[5], -1);
- TextDrawTextSize(MemoryLine[5], 453.000000, -3.000000);
- MemoryLine[6] = TextDrawCreate(170.000000, 172.000000, "_");
- TextDrawBackgroundColor(MemoryLine[6], 255);
- TextDrawFont(MemoryLine[6], 1);
- TextDrawLetterSize(MemoryLine[6], 1.399999, -0.199999);
- TextDrawColor(MemoryLine[6], -1);
- TextDrawSetOutline(MemoryLine[6], 0);
- TextDrawSetProportional(MemoryLine[6], 1);
- TextDrawSetShadow(MemoryLine[6], 1);
- TextDrawUseBox(MemoryLine[6], 1);
- TextDrawBoxColor(MemoryLine[6], -1);
- TextDrawTextSize(MemoryLine[6], 453.000000, -3.000000);
- MemoryLine[7] = TextDrawCreate(170.000000, 240.000000, "_");
- TextDrawBackgroundColor(MemoryLine[7], 255);
- TextDrawFont(MemoryLine[7], 1);
- TextDrawLetterSize(MemoryLine[7], 1.399999, -0.199999);
- TextDrawColor(MemoryLine[7], -1);
- TextDrawSetOutline(MemoryLine[7], 0);
- TextDrawSetProportional(MemoryLine[7], 1);
- TextDrawSetShadow(MemoryLine[7], 1);
- TextDrawUseBox(MemoryLine[7], 1);
- TextDrawBoxColor(MemoryLine[7], -1);
- TextDrawTextSize(MemoryLine[7], 453.000000, -3.000000);
- MemoryLine[8] = TextDrawCreate(170.000000, 310.000000, "_");
- TextDrawBackgroundColor(MemoryLine[8], 255);
- TextDrawFont(MemoryLine[8], 1);
- TextDrawLetterSize(MemoryLine[8], 1.399999, -0.199999);
- TextDrawColor(MemoryLine[8], -1);
- TextDrawSetOutline(MemoryLine[8], 0);
- TextDrawSetProportional(MemoryLine[8], 1);
- TextDrawSetShadow(MemoryLine[8], 1);
- TextDrawUseBox(MemoryLine[8], 1);
- TextDrawBoxColor(MemoryLine[8], -1);
- TextDrawTextSize(MemoryLine[8], 453.000000, -3.000000);
- MemoryLine[9] = TextDrawCreate(170.000000, 380.000000, "_");
- TextDrawBackgroundColor(MemoryLine[9], 255);
- TextDrawFont(MemoryLine[9], 1);
- TextDrawLetterSize(MemoryLine[9], 1.399999, -0.199999);
- TextDrawColor(MemoryLine[9], -1);
- TextDrawSetOutline(MemoryLine[9], 0);
- TextDrawSetProportional(MemoryLine[9], 1);
- TextDrawSetShadow(MemoryLine[9], 1);
- TextDrawUseBox(MemoryLine[9], 1);
- TextDrawBoxColor(MemoryLine[9], -1);
- TextDrawTextSize(MemoryLine[9], 453.000000, -3.000000);
- MemoryBox[0] = TextDrawCreate(173.000000, 112.000000, "_");//1
- TextDrawBackgroundColor(MemoryBox[0], 255);
- TextDrawFont(MemoryBox[0], 0);
- TextDrawLetterSize(MemoryBox[0], 0.500000, 6.199998);
- TextDrawColor(MemoryBox[0], 255);
- TextDrawSetOutline(MemoryBox[0], 0);
- TextDrawSetProportional(MemoryBox[0], 1);
- TextDrawSetShadow(MemoryBox[0], 0);
- TextDrawUseBox(MemoryBox[0], 1);
- TextDrawBoxColor(MemoryBox[0], 255);
- TextDrawTextSize(MemoryBox[0], 239.000000, 0.000000);
- MemoryBox[1] = TextDrawCreate(246.000000, 112.000000, "_");//2
- TextDrawBackgroundColor(MemoryBox[1], 255);
- TextDrawFont(MemoryBox[1], 0);
- TextDrawLetterSize(MemoryBox[1], 0.500000, 6.199998);
- TextDrawColor(MemoryBox[1], 255);
- TextDrawSetOutline(MemoryBox[1], 0);
- TextDrawSetProportional(MemoryBox[1], 1);
- TextDrawSetShadow(MemoryBox[1], 0);
- TextDrawUseBox(MemoryBox[1], 1);
- TextDrawBoxColor(MemoryBox[1], 255);
- TextDrawTextSize(MemoryBox[1], 313.000000, 0.000000);
- MemoryBox[2] = TextDrawCreate(320.000000, 112.000000, "_");//3
- TextDrawBackgroundColor(MemoryBox[2], 255);
- TextDrawFont(MemoryBox[2], 0);
- TextDrawLetterSize(MemoryBox[2], 0.500000, 6.199998);
- TextDrawColor(MemoryBox[2], 255);
- TextDrawSetOutline(MemoryBox[2], 0);
- TextDrawSetProportional(MemoryBox[2], 1);
- TextDrawSetShadow(MemoryBox[2], 0);
- TextDrawUseBox(MemoryBox[2], 1);
- TextDrawBoxColor(MemoryBox[2], 255);
- TextDrawTextSize(MemoryBox[2], 379.000000, 0.000000);
- MemoryBox[3] = TextDrawCreate(387.000000, 112.000000, "_");//4
- TextDrawBackgroundColor(MemoryBox[3], 255);
- TextDrawFont(MemoryBox[3], 0);
- TextDrawLetterSize(MemoryBox[3], 0.500000, 6.199998);
- TextDrawColor(MemoryBox[3], 255);
- TextDrawSetOutline(MemoryBox[3], 0);
- TextDrawSetProportional(MemoryBox[3], 1);
- TextDrawSetShadow(MemoryBox[3], 0);
- TextDrawUseBox(MemoryBox[3], 1);
- TextDrawBoxColor(MemoryBox[3], 255);
- TextDrawTextSize(MemoryBox[3], 450.000000, 0.000000);
- MemoryBox[4] = TextDrawCreate(173.000000, 175.000000, "_");//5
- TextDrawBackgroundColor(MemoryBox[4], 255);
- TextDrawFont(MemoryBox[4], 0);
- TextDrawLetterSize(MemoryBox[4], 0.500000, 6.699998);
- TextDrawColor(MemoryBox[4], 255);
- TextDrawSetOutline(MemoryBox[4], 0);
- TextDrawSetProportional(MemoryBox[4], 1);
- TextDrawSetShadow(MemoryBox[4], 0);
- TextDrawUseBox(MemoryBox[4], 1);
- TextDrawBoxColor(MemoryBox[4], 255);
- TextDrawTextSize(MemoryBox[4], 239.000000, 0.000000);
- MemoryBox[5] = TextDrawCreate(246.000000, 175.000000, "_");//6
- TextDrawBackgroundColor(MemoryBox[5], 255);
- TextDrawFont(MemoryBox[5], 0);
- TextDrawLetterSize(MemoryBox[5], 0.500000, 6.699998);
- TextDrawColor(MemoryBox[5], 255);
- TextDrawSetOutline(MemoryBox[5], 0);
- TextDrawSetProportional(MemoryBox[5], 1);
- TextDrawSetShadow(MemoryBox[5], 0);
- TextDrawUseBox(MemoryBox[5], 1);
- TextDrawBoxColor(MemoryBox[5], 255);
- TextDrawTextSize(MemoryBox[5], 313.000000, 0.000000);
- MemoryBox[6] = TextDrawCreate(321.000000, 175.000000, "_");//7
- TextDrawBackgroundColor(MemoryBox[6], 255);
- TextDrawFont(MemoryBox[6], 0);
- TextDrawLetterSize(MemoryBox[6], 0.500000, 6.699997);
- TextDrawColor(MemoryBox[6], 255);
- TextDrawSetOutline(MemoryBox[6], 0);
- TextDrawSetProportional(MemoryBox[6], 1);
- TextDrawSetShadow(MemoryBox[6], 0);
- TextDrawUseBox(MemoryBox[6], 1);
- TextDrawBoxColor(MemoryBox[6], 255);
- TextDrawTextSize(MemoryBox[6], 379.000000, 0.000000);
- MemoryBox[7] = TextDrawCreate(387.000000, 175.000000, "_");//8
- TextDrawBackgroundColor(MemoryBox[7], 255);
- TextDrawFont(MemoryBox[7], 0);
- TextDrawLetterSize(MemoryBox[7], 0.500000, 6.699997);
- TextDrawColor(MemoryBox[7], 255);
- TextDrawSetOutline(MemoryBox[7], 0);
- TextDrawSetProportional(MemoryBox[7], 1);
- TextDrawSetShadow(MemoryBox[7], 0);
- TextDrawUseBox(MemoryBox[7], 1);
- TextDrawBoxColor(MemoryBox[7], 255);
- TextDrawTextSize(MemoryBox[7], 450.000000, 1.000000);
- MemoryBox[8] = TextDrawCreate(173.000000, 243.000000, "_");//9
- TextDrawBackgroundColor(MemoryBox[8], 255);
- TextDrawFont(MemoryBox[8], 0);
- TextDrawLetterSize(MemoryBox[8], 0.500000, 6.899998);
- TextDrawColor(MemoryBox[8], 255);
- TextDrawSetOutline(MemoryBox[8], 0);
- TextDrawSetProportional(MemoryBox[8], 1);
- TextDrawSetShadow(MemoryBox[8], 0);
- TextDrawUseBox(MemoryBox[8], 1);
- TextDrawBoxColor(MemoryBox[8], 255);
- TextDrawTextSize(MemoryBox[8], 239.000000, 1.000000);
- MemoryBox[9] = TextDrawCreate(246.000000, 243.000000, "_");//10
- TextDrawBackgroundColor(MemoryBox[9], 255);
- TextDrawFont(MemoryBox[9], 0);
- TextDrawLetterSize(MemoryBox[9], 0.500000, 6.899998);
- TextDrawColor(MemoryBox[9], 255);
- TextDrawSetOutline(MemoryBox[9], 0);
- TextDrawSetProportional(MemoryBox[9], 1);
- TextDrawSetShadow(MemoryBox[9], 0);
- TextDrawUseBox(MemoryBox[9], 1);
- TextDrawBoxColor(MemoryBox[9], 255);
- TextDrawTextSize(MemoryBox[9], 313.000000, 1.000000);
- MemoryBox[10] = TextDrawCreate(321.000000, 243.000000, "_");//11
- TextDrawBackgroundColor(MemoryBox[10], 255);
- TextDrawFont(MemoryBox[10], 0);
- TextDrawLetterSize(MemoryBox[10], 0.500000, 6.899998);
- TextDrawColor(MemoryBox[10], 255);
- TextDrawSetOutline(MemoryBox[10], 0);
- TextDrawSetProportional(MemoryBox[10], 1);
- TextDrawSetShadow(MemoryBox[10], 0);
- TextDrawUseBox(MemoryBox[10], 1);
- TextDrawBoxColor(MemoryBox[10], 255);
- TextDrawTextSize(MemoryBox[10], 380.000000, 1.000000);
- MemoryBox[11] = TextDrawCreate(387.000000, 243.000000, "_");//12
- TextDrawBackgroundColor(MemoryBox[11], 255);
- TextDrawFont(MemoryBox[11], 0);
- TextDrawLetterSize(MemoryBox[11], 0.500000, 6.899998);
- TextDrawColor(MemoryBox[11], 255);
- TextDrawSetOutline(MemoryBox[11], 0);
- TextDrawSetProportional(MemoryBox[11], 1);
- TextDrawSetShadow(MemoryBox[11], 0);
- TextDrawUseBox(MemoryBox[11], 1);
- TextDrawBoxColor(MemoryBox[11], 255);
- TextDrawTextSize(MemoryBox[11], 450.000000, 1.000000);
- MemoryBox[12] = TextDrawCreate(174.000000, 313.000000, "_");//13
- TextDrawBackgroundColor(MemoryBox[12], 255);
- TextDrawFont(MemoryBox[12], 0);
- TextDrawLetterSize(MemoryBox[12], 0.509998, 6.999998);
- TextDrawColor(MemoryBox[12], 255);
- TextDrawSetOutline(MemoryBox[12], 0);
- TextDrawSetProportional(MemoryBox[12], 1);
- TextDrawSetShadow(MemoryBox[12], 0);
- TextDrawUseBox(MemoryBox[12], 1);
- TextDrawBoxColor(MemoryBox[12], 255);
- TextDrawTextSize(MemoryBox[12], 239.000000, 1.000000);
- MemoryBox[13] = TextDrawCreate(246.000000, 313.000000, "_");//14
- TextDrawBackgroundColor(MemoryBox[13], 255);
- TextDrawFont(MemoryBox[13], 0);
- TextDrawLetterSize(MemoryBox[13], 0.509998, 6.999998);
- TextDrawColor(MemoryBox[13], 255);
- TextDrawSetOutline(MemoryBox[13], 0);
- TextDrawSetProportional(MemoryBox[13], 1);
- TextDrawSetShadow(MemoryBox[13], 0);
- TextDrawUseBox(MemoryBox[13], 1);
- TextDrawBoxColor(MemoryBox[13], 255);
- TextDrawTextSize(MemoryBox[13], 313.000000, 1.000000);
- MemoryBox[14] = TextDrawCreate(320.000000, 313.000000, "_");//15
- TextDrawBackgroundColor(MemoryBox[14], 255);
- TextDrawFont(MemoryBox[14], 0);
- TextDrawLetterSize(MemoryBox[14], 0.509998, 6.999998);
- TextDrawColor(MemoryBox[14], 255);
- TextDrawSetOutline(MemoryBox[14], 0);
- TextDrawSetProportional(MemoryBox[14], 1);
- TextDrawSetShadow(MemoryBox[14], 0);
- TextDrawUseBox(MemoryBox[14], 1);
- TextDrawBoxColor(MemoryBox[14], 255);
- TextDrawTextSize(MemoryBox[14], 380.000000, 1.000000);
- MemoryBox[15] = TextDrawCreate(387.000000, 313.000000, "_");//16
- TextDrawBackgroundColor(MemoryBox[15], 255);
- TextDrawFont(MemoryBox[15], 0);
- TextDrawLetterSize(MemoryBox[15], 0.509998, 6.999998);
- TextDrawColor(MemoryBox[15], 255);
- TextDrawSetOutline(MemoryBox[15], 0);
- TextDrawSetProportional(MemoryBox[15], 1);
- TextDrawSetShadow(MemoryBox[15], 0);
- TextDrawUseBox(MemoryBox[15], 1);
- TextDrawBoxColor(MemoryBox[15], 255);
- TextDrawTextSize(MemoryBox[15], 450.000000, 1.000000);
- MemoryExtra[0] = TextDrawCreate(213.000000, 69.000000, "Memory MiniGame");
- TextDrawBackgroundColor(MemoryExtra[0], 255);
- TextDrawFont(MemoryExtra[0], 0);
- TextDrawLetterSize(MemoryExtra[0], 0.889999, 3.000000);
- TextDrawColor(MemoryExtra[0], -1);
- TextDrawSetOutline(MemoryExtra[0], 1);
- TextDrawSetProportional(MemoryExtra[0], 1);
- MemoryExtra[1] = TextDrawCreate(509.000000, 130.000000, "_____");
- TextDrawBackgroundColor(MemoryExtra[1], 255);
- TextDrawFont(MemoryExtra[1], 1);
- TextDrawLetterSize(MemoryExtra[1], 0.500000, 3.000000);
- TextDrawColor(MemoryExtra[1], -1);
- TextDrawSetOutline(MemoryExtra[1], 1);
- TextDrawSetProportional(MemoryExtra[1], 1);
- TextDrawUseBox(MemoryExtra[1], 1);
- TextDrawBoxColor(MemoryExtra[1], 255);
- TextDrawTextSize(MemoryExtra[1], 600.000000, 0.000000);
- MemoryExtra[2] = TextDrawCreate(511.000000, 132.000000, "_____");
- TextDrawBackgroundColor(MemoryExtra[2], 255);
- TextDrawFont(MemoryExtra[2], 1);
- TextDrawLetterSize(MemoryExtra[2], 0.500000, 2.599999);
- TextDrawColor(MemoryExtra[2], -1);
- TextDrawSetOutline(MemoryExtra[2], 1);
- TextDrawSetProportional(MemoryExtra[2], 1);
- TextDrawUseBox(MemoryExtra[2], 1);
- TextDrawBoxColor(MemoryExtra[2], -1);
- TextDrawTextSize(MemoryExtra[2], 598.000000, 1.000000);
- MemoryExtra[3] = TextDrawCreate(512.000000, 133.000000, "_____");
- TextDrawBackgroundColor(MemoryExtra[3], 255);
- TextDrawFont(MemoryExtra[3], 1);
- TextDrawLetterSize(MemoryExtra[3], 0.000000, 2.400000);
- TextDrawColor(MemoryExtra[3], -1);
- TextDrawSetOutline(MemoryExtra[3], 1);
- TextDrawSetProportional(MemoryExtra[3], 1);
- TextDrawUseBox(MemoryExtra[3], 1);
- TextDrawBoxColor(MemoryExtra[3], 255);
- TextDrawTextSize(MemoryExtra[3], 596.000000, 1.000000);
- MemoryExtra[4] = TextDrawCreate(527.000000, 125.000000, "Time");
- TextDrawBackgroundColor(MemoryExtra[4], 255);
- TextDrawFont(MemoryExtra[4], 1);
- TextDrawLetterSize(MemoryExtra[4], 0.500000, 1.000000);
- TextDrawColor(MemoryExtra[4], -1);
- TextDrawSetOutline(MemoryExtra[4], 1);
- TextDrawSetProportional(MemoryExtra[4], 1);
- CorrectTD = TextDrawCreate(516.000000, 182.000000, "~g~Correct !");
- TextDrawBackgroundColor(CorrectTD, 255);
- TextDrawFont(CorrectTD, 1);
- TextDrawLetterSize(CorrectTD, 0.600000, 2.000000);
- TextDrawColor(CorrectTD, -1);
- TextDrawSetOutline(CorrectTD, 1);
- TextDrawSetProportional(CorrectTD, 1);
- WrongTD = TextDrawCreate(516.000000, 182.000000, "~r~Wrong !");
- TextDrawBackgroundColor(WrongTD, 255);
- TextDrawFont(WrongTD, 1);
- TextDrawLetterSize(WrongTD, 0.600000, 2.000000);
- TextDrawColor(WrongTD, -1);
- TextDrawSetOutline(WrongTD, 1);
- TextDrawSetProportional(WrongTD, 1);
- CompletedTD = TextDrawCreate(500.000000, 182.000000, "~y~Completed !");
- TextDrawBackgroundColor(CompletedTD, 255);
- TextDrawFont(CompletedTD, 1);
- TextDrawLetterSize(CompletedTD, 0.600000, 2.000000);
- TextDrawColor(CompletedTD, -1);
- TextDrawSetOutline(CompletedTD, 1);
- TextDrawSetProportional(CompletedTD, 1);
- for(new i, j = GetMaxPlayers(); i < j; i++)
- {
- MemoryTimer[i] = TextDrawCreate(518.000000, 139.000000, "00 : 00");
- TextDrawBackgroundColor(MemoryTimer[i], 255);
- TextDrawFont(MemoryTimer[i], 0);
- TextDrawLetterSize(MemoryTimer[i], 0.500000, 1.000000);
- TextDrawColor(MemoryTimer[i], -1);
- TextDrawSetOutline(MemoryTimer[i], 1);
- TextDrawSetProportional(MemoryTimer[i], 1);
- }
- MapCover = GangZoneCreate(-3000, -3000, 3000, 3000);
- new string[5];
- new File: file = fopen("memory_best.log", io_read);
- if (file)
- {
- fread(file, string);
- BestTime = strval(string);
- }
- SendClientMessageToAll(COLOR_ORANGE, "• Memory MiniGame FS loaded, part of it by typing /memory");
- print("\n¤ Memory MiniGame FS successfully loaded !\n");
- return 1;
- }
- //------------------------------------------------------------------------------
- public OnFilterScriptExit()
- {
- new i;
- for(new j = GetMaxPlayers(); i < j; i++)
- {
- if(PlayingMemory[i])
- {
- MemoryEndForPlayer(i);
- TextDrawDestroy(MemoryTimer[i]);
- KillTimer(ScoreTimer[i]);
- }
- }
- for(i=0; i<5; i++)
- {
- TextDrawDestroy(MemoryLine[i]);
- TextDrawDestroy(MemoryBox[i]);
- TextDrawDestroy(MemoryExtra[i]);
- }
- for(; i<10; i++)
- {
- TextDrawDestroy(MemoryLine[i]);
- TextDrawDestroy(MemoryBox[i]);
- }
- for(; i<16; i++)
- {
- TextDrawDestroy(MemoryBox[i]);
- }
- TextDrawDestroy(CorrectTD);
- TextDrawDestroy(WrongTD);
- TextDrawDestroy(CompletedTD);
- GangZoneDestroy(MapCover);
- new string[5];
- format(string, sizeof(string), "%d", BestTime);
- new File: file = fopen("memory_best.log", io_write);
- fwrite(file, string);
- fclose(file);
- SendClientMessageToAll(COLOR_ORANGE, "• You can no longer use the Memory MiniGame FS, thanks for participating !");
- print("\n¤ Memory MiniGame FS successfully unloaded !\n");
- return 1;
- }
- //------------------------------------------------------------------------------
- public OnPlayerDisconnect(playerid, reason)
- {
- if(PlayingMemory[playerid])
- {
- cmd_memory(playerid, "");
- }
- }
- //------------------------------------------------------------------------------
- COMMAND:memory(playerid, params[])
- {
- new string[128], i, j, k;
- if(PlayingMemory[playerid])
- {
- GetPlayerName(playerid, string, 128);
- for(; i<10; i++) SendClientMessage(playerid, 0, " ");
- if(PlayingMemory[playerid] == 2)
- {
- if(MemoryTime[playerid] < BestTime)
- {
- BestTime = MemoryTime[playerid];
- format(string, 128, "%s obtained the best result at the {FFAF02}Memory MiniGame{FFFFFF} with a time of {FF0000}%d minutes e %d seconds !", string, MemoryTime[playerid]/60, MemoryTime[playerid] - (60*(MemoryTime[playerid]/60)));
- }
- else format(string, 128, "%s has completed the {FFAF02}Memory MiniGame{FFFFFF} with a time of %d minutes e %d seconds", string, MemoryTime[playerid]/60, MemoryTime[playerid] - (60*(MemoryTime[playerid]/60)));
- }
- else
- {
- format(string, 128, "%s has stopped playing the {FFAF02}Memory MiniGame", string);
- KillTimer(ScoreTimer[playerid]);
- }
- SendClientMessageToAll(COLOR_WHITE, string);
- for(i=0; i<5; i++)
- {
- TextDrawHideForPlayer(playerid, MemoryLine[i]);
- TextDrawHideForPlayer(playerid, MemoryBox[i]);
- TextDrawHideForPlayer(playerid, MemoryExtra[i]);
- }
- for(; i<10; i++)
- {
- TextDrawHideForPlayer(playerid, MemoryLine[i]);
- TextDrawHideForPlayer(playerid, MemoryBox[i]);
- }
- for(; i<16; i++)
- {
- TextDrawHideForPlayer(playerid, MemoryBox[i]);
- }
- TextDrawHideForPlayer(playerid, MemoryTimer[playerid]);
- TextDrawHideForPlayer(playerid, CorrectTD);
- TextDrawHideForPlayer(playerid, WrongTD);
- TextDrawHideForPlayer(playerid, CompletedTD);
- for(j = 0; j < MEM_TAB; j++)
- {
- for(k = 0; k < MEM_TAB; k++)
- {
- MemoryColor[playerid][j][k] = 0;
- }
- }
- PlayingMemory[playerid] = 0;
- GangZoneHideForPlayer(playerid, MapCover);
- MemoryEndForPlayer(playerid);
- }
- else
- {
- PlayingMemory[playerid] = 1;
- MemoryTime[playerid] = 0;
- GetPlayerName(playerid, string, 128);
- for(; i<10; i++) SendClientMessage(playerid, 0, " ");
- format(string, 128, "%s started playing the {FFAF02}Memory MiniGame", string);
- SendClientMessageToAll(COLOR_WHITE, string);
- PlayerPos[playerid][PPInt] = GetPlayerInterior(playerid);
- PlayerPos[playerid][PPVW] = GetPlayerVirtualWorld(playerid);
- GetPlayerPos(playerid, PlayerPos[playerid][PPX], PlayerPos[playerid][PPY], PlayerPos[playerid][PPZ]);
- SetPlayerVirtualWorld(playerid, playerid);
- SetPlayerPos(playerid, 1947.6558,-2404.1008,13.5469);
- TogglePlayerControllable(playerid, 0);
- SetPlayerCameraPos(playerid,1939.224,-2405.605,30.239);
- SetPlayerCameraLookAt(playerid,1939.260,-2401.041,-1.453);
- PlayerClickX[playerid] = PlayerClickY[playerid] = MEM_TAB;
- PlayerX[playerid] = PlayerX[playerid] = 0;
- KeyTimer[playerid] = SetTimerEx("KeyCheck", 150, 1, "i", playerid);
- ScoreTimer[playerid] = SetTimerEx("ScoreCheck", 1000, 1, "i", playerid);
- GangZoneShowForPlayer(playerid, MapCover, 0x000000FF);
- for(i=0; i<5; i++)
- {
- TextDrawShowForPlayer(playerid, MemoryLine[i]);
- TextDrawShowForPlayer(playerid, MemoryBox[i]);
- TextDrawShowForPlayer(playerid, MemoryExtra[i]);
- }
- for(; i<10; i++)
- {
- TextDrawShowForPlayer(playerid, MemoryLine[i]);
- TextDrawShowForPlayer(playerid, MemoryBox[i]);
- }
- for(; i<16; i++)
- {
- TextDrawShowForPlayer(playerid, MemoryBox[i]);
- }
- TextDrawShowForPlayer(playerid, MemoryTimer[playerid]);
- new C1_ranx, C1_rany, C2_ranx, C2_rany, check, full, col,
- Colors[8] = {1,2,3,5,6,16,40,77};
- do
- {
- do
- {
- C1_ranx = random(MEM_TAB);
- C1_rany = random(MEM_TAB);
- if(MemoryColor[playerid][C1_ranx][C1_rany] == 0)
- {
- MemoryColor[playerid][C1_ranx][C1_rany] = Colors[col];
- do
- {
- C2_ranx = random(MEM_TAB);
- C2_rany = random(MEM_TAB);
- if(MemoryColor[playerid][C2_ranx][C2_rany] == 0)
- {
- MemoryColor[playerid][C2_ranx][C2_rany] = Colors[col];
- col++;
- check = 1;
- }
- }
- while(!check);
- }
- }
- while(!check);
- check = 0;
- full = 0;
- /*for(j = 0; j < MEM_TAB; j++)
- {
- printf("%d|%d|%d|%d",
- MemoryColor[playerid][j][0],
- MemoryColor[playerid][j][1],
- MemoryColor[playerid][j][2],
- MemoryColor[playerid][j][3]);
- print ("-------");
- }*/
- for(j = 0; j < MEM_TAB; j++)
- {
- for(k = 0; k < MEM_TAB; k++)
- {
- if(MemoryColor[playerid][j][k] == 0) full = 1;
- }
- }
- }
- while(full);
- for(j = 0; j < MEM_TAB; j++)
- {
- for(k = 0; k < MEM_TAB; k++)
- {
- MemoryVehicle[playerid][check] = CreateVehicle(471, 1934.917+(2.7*k), -2399.522-(2.8*j), 13.024,0, MemoryColor[playerid][j][k], MemoryColor[playerid][j][k], 30000);
- SetVehicleVirtualWorld(MemoryVehicle[playerid][check], playerid);
- check++;
- }
- }
- }
- return 1;
- }
- //------------------------------------------------------------------------------
- stock MemoryEndForPlayer(playerid)
- {
- KillTimer(KeyTimer[playerid]);
- SetCameraBehindPlayer(playerid);
- SetPlayerInterior(playerid, PlayerPos[playerid][PPInt]);
- SetPlayerVirtualWorld(playerid, PlayerPos[playerid][PPVW]);
- SetPlayerPos(playerid, PlayerPos[playerid][PPX], PlayerPos[playerid][PPY], PlayerPos[playerid][PPZ]);
- TogglePlayerControllable(playerid, 1);
- for(new j; j<MEM_TAB*MEM_TAB; j++) DestroyVehicle(MemoryVehicle[playerid][j]);
- }
- //------------------------------------------------------------------------------
- public KeyCheck(playerid)
- {
- new keys, updown, leftright;
- new i, j;
- GetPlayerKeys(playerid, keys, updown, leftright);
- if(keys & KEY_FIRE)
- {
- if(MemoryColor[playerid][PlayerX[playerid]][PlayerY[playerid]] != 0)
- {
- if(PlayerClickX[playerid] == MEM_TAB && PlayerClickX[playerid] == MEM_TAB)
- {
- TextDrawHideForPlayer(playerid, MemoryBox[ TDO[ PlayerX[playerid] ] [ PlayerY[playerid] ] ]);
- PlayerClickX[playerid] = PlayerX[playerid];
- PlayerClickY[playerid] = PlayerY[playerid];
- TextDrawHideForPlayer(playerid, CorrectTD);
- TextDrawHideForPlayer(playerid, WrongTD);
- }
- else if(PlayerClickX[playerid] != PlayerX[playerid] || PlayerClickY[playerid] != PlayerY[playerid])
- {
- if(MemoryColor[playerid][PlayerClickX[playerid]][PlayerClickY[playerid]] == MemoryColor[playerid][PlayerX[playerid]][PlayerY[playerid]])
- {
- TextDrawHideForPlayer(playerid, MemoryBox[ TDO[ PlayerX[playerid] ] [ PlayerY[playerid] ] ]);
- TextDrawHideForPlayer(playerid, MemoryBox[ TDO[ PlayerClickX[playerid] ] [ PlayerClickY[playerid] ] ]);
- TextDrawShowForPlayer(playerid, CorrectTD);
- MemoryColor[playerid][PlayerX[playerid]][PlayerY[playerid]] = 0;
- MemoryColor[playerid][PlayerClickX[playerid]][PlayerClickY[playerid]] = 0;
- PlayerClickX[playerid] = PlayerClickY[playerid] = MEM_TAB;
- new flag;
- for(; i < MEM_TAB; i++)
- {
- for(j = 0; j < MEM_TAB; j++)
- {
- if(MemoryColor[playerid][i][j] != 0) flag = 1;
- }
- }
- if(!flag)
- {
- TextDrawHideForPlayer(playerid, CorrectTD);
- TextDrawHideForPlayer(playerid, WrongTD);
- TextDrawShowForPlayer(playerid, CompletedTD);
- PlayingMemory[playerid] = 2;
- KillTimer(ScoreTimer[playerid]);
- SetTimerEx("cmd_memory", 3500, 0, "is", playerid, " ");
- }
- }
- else
- {
- TextDrawShowForPlayer(playerid, WrongTD);
- TextDrawHideForPlayer(playerid, MemoryBox[ TDO[ PlayerX[playerid] ] [ PlayerY[playerid] ] ]);
- SetTimerEx("CoverMem", 1000, 0, "iii", playerid, _:MemoryBox[ TDO[ PlayerX[playerid] ] [ PlayerY[playerid] ] ], _:MemoryBox[ TDO[ PlayerClickX[playerid] ] [ PlayerClickY[playerid] ] ]);
- PlayerClickX[playerid] = PlayerClickY[playerid] = MEM_TAB;
- }
- }
- }
- }
- else if(updown != 0 || leftright != 0)
- {
- for(; i < MEM_TAB; i++)
- {
- for(j = 0; j < MEM_TAB; j++)
- {
- if(MemoryColor[playerid][i][j] != 0)
- {
- TextDrawHideForPlayer(playerid, MemoryBox[TDO[i][j]]);
- TextDrawUseBox(MemoryBox[TDO[i][j]], 1);
- TextDrawBoxColor(MemoryBox[TDO[i][j]], 255);
- TextDrawShowForPlayer(playerid, MemoryBox[TDO[i][j]]);
- }
- else TextDrawHideForPlayer(playerid, MemoryBox[TDO[i][j]]);
- }
- }
- if(PlayerClickX[playerid] != MEM_TAB) TextDrawHideForPlayer(playerid, MemoryBox[TDO[PlayerClickX[playerid]][PlayerClickY[playerid]]]);
- if(leftright == KEY_RIGHT)
- {
- PlayerY[playerid]++;
- }
- else if(leftright == KEY_LEFT)
- {
- PlayerY[playerid]--;
- }
- else if(updown == KEY_UP)
- {
- PlayerX[playerid]--;
- }
- else if(updown == KEY_DOWN)
- {
- PlayerX[playerid]++;
- }
- if(PlayerX[playerid] < 0) PlayerX[playerid] = MEM_TAB-1;
- else if(PlayerX[playerid] == MEM_TAB) PlayerX[playerid] = 0;
- if(PlayerY[playerid] < 0) PlayerY[playerid] = MEM_TAB-1;
- else if(PlayerY[playerid] == MEM_TAB) PlayerY[playerid] = 0;
- TextDrawHideForPlayer(playerid, MemoryBox[TDO[PlayerX[playerid]][PlayerY[playerid]]]);
- TextDrawUseBox(MemoryBox[TDO[PlayerX[playerid]][PlayerY[playerid]]], 1);
- TextDrawBoxColor(MemoryBox[TDO[PlayerX[playerid]][PlayerY[playerid]]], COLOR_WHITE);
- TextDrawShowForPlayer(playerid, MemoryBox[TDO[PlayerX[playerid]][PlayerY[playerid]]]);
- //new string[64];
- //format(string, 64, "TDO: %d || X-Y: %d-%d || OX-OY: %d-%d", TDO[PlayerX[playerid]][PlayerY[playerid]], PlayerX[playerid], PlayerY[playerid], PlayerClickX[playerid], PlayerClickY[playerid]);
- //SendClientMessage(playerid, COLOR_WHITE, string);
- }
- }
- //------------------------------------------------------------------------------
- public ScoreCheck(playerid)
- {
- new string[32];
- format(string, 32, "00 : %02d", MemoryTime[playerid]);
- if(MemoryTime[playerid] > 59) format(string, 32, "%02d : %02d", MemoryTime[playerid]/60, MemoryTime[playerid] - (60*(MemoryTime[playerid]/60)));
- TextDrawSetString(MemoryTimer[playerid], string);
- MemoryTime[playerid]++;
- }
- //------------------------------------------------------------------------------
- public CoverMem(playerid, Text:TD1, Text:TD2)
- {
- TextDrawShowForPlayer(playerid, TD1), TextDrawShowForPlayer(playerid, TD2);
- }
- //------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement