Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <sscanf2>
- #include <zcmd>
- #define COLOR_INFO 0xFFFFFFFF
- new Text:txt_GrattaVinci;
- new Text:txt_Block1;
- new Text:txt_Block2;
- new Text:txt_Block3;
- new Text:txt_Num1;
- new Text:txt_Num2;
- new Text:txt_Num3;
- new Text:txt_E;
- new RandomNums[][] =
- {
- "3",
- "2"
- };
- forward GrattaVinciEnter(playerid);
- forward Num_1(playerid);
- forward Num_2(playerid);
- forward Num_3(playerid);
- forward GrattaVinciExit(playerid);
- forward GrattaVinciFinished(playerid);
- public OnFilterScriptInit()
- {
- txt_GrattaVinci = TextDrawCreate(250.000000, 131.000000, "Gratta Vinci");
- TextDrawAlignment(txt_GrattaVinci, 2);
- TextDrawBackgroundColor(txt_GrattaVinci, 255);
- TextDrawFont(txt_GrattaVinci, 1);
- TextDrawLetterSize(txt_GrattaVinci, 0.500000, 7.199995);
- TextDrawColor(txt_GrattaVinci, -65281);
- TextDrawSetOutline(txt_GrattaVinci, 1);
- TextDrawSetProportional(txt_GrattaVinci, 1);
- TextDrawUseBox(txt_GrattaVinci, 1);
- TextDrawBoxColor(txt_GrattaVinci, -65281);
- TextDrawTextSize(txt_GrattaVinci, 0.000000, 224.000000);
- txt_Block1 = TextDrawCreate(161.000000, 154.000000, "0");
- TextDrawAlignment(txt_Block1, 2);
- TextDrawBackgroundColor(txt_Block1, 255);
- TextDrawFont(txt_Block1, 1);
- TextDrawLetterSize(txt_Block1, 0.500000, 2.000000);
- TextDrawColor(txt_Block1,255);
- TextDrawSetOutline(txt_Block1, 0);
- TextDrawSetProportional(txt_Block1, 1);
- TextDrawSetShadow(txt_Block1, 1);
- TextDrawUseBox(txt_Block1, 1);
- TextDrawBoxColor(txt_Block1, 255);
- TextDrawTextSize(txt_Block1, 0.000000, 29.000000);
- txt_Block2 = TextDrawCreate(258.000000, 155.000000, "0");
- TextDrawAlignment(txt_Block2, 2);
- TextDrawBackgroundColor(txt_Block2, 255);
- TextDrawFont(txt_Block2, 1);
- TextDrawLetterSize(txt_Block2, 0.500000, 2.000000);
- TextDrawColor(txt_Block2, 255);
- TextDrawSetOutline(txt_Block2, 0);
- TextDrawSetProportional(txt_Block2, 1);
- TextDrawSetShadow(txt_Block2, 1);
- TextDrawUseBox(txt_Block2, 1);
- TextDrawBoxColor(txt_Block2, 255);
- TextDrawTextSize(txt_Block2, 0.000000, 29.000000);
- txt_Block3 = TextDrawCreate(338.000000, 155.000000, "0");
- TextDrawAlignment(txt_Block3, 2);
- TextDrawBackgroundColor(txt_Block3, 255);
- TextDrawFont(txt_Block3, 1);
- TextDrawLetterSize(txt_Block3, 0.500000, 2.000000);
- TextDrawColor(txt_Block3, 255);
- TextDrawSetOutline(txt_Block3, 0);
- TextDrawSetProportional(txt_Block3, 1);
- TextDrawSetShadow(txt_Block3, 1);
- TextDrawUseBox(txt_Block3, 1);
- TextDrawBoxColor(txt_Block3, 255);
- TextDrawTextSize(txt_Block3, 0.000000, 29.000000);
- txt_Num1 = TextDrawCreate(161.000000, 154.000000, "");
- TextDrawAlignment(txt_Num1, 2);
- TextDrawBackgroundColor(txt_Num1, 255);
- TextDrawFont(txt_Num1, 1);
- TextDrawLetterSize(txt_Num1, 0.500000, 2.000000);
- TextDrawColor(txt_Num1, 16711935);
- TextDrawSetOutline(txt_Num1, 0);
- TextDrawSetProportional(txt_Num1, 1);
- TextDrawSetShadow(txt_Num1, 1);
- TextDrawUseBox(txt_Num1, 1);
- TextDrawBoxColor(txt_Num1, -1);
- TextDrawTextSize(txt_Num1, 0.000000, 29.000000);
- txt_Num2 = TextDrawCreate(258.000000, 155.000000, "");
- TextDrawAlignment(txt_Num2, 2);
- TextDrawBackgroundColor(txt_Num2, 255);
- TextDrawFont(txt_Num2, 1);
- TextDrawLetterSize(txt_Num2, 0.500000, 2.000000);
- TextDrawColor(txt_Num2, 16711935);
- TextDrawSetOutline(txt_Num2, 0);
- TextDrawSetProportional(txt_Num2, 1);
- TextDrawSetShadow(txt_Num2, 1);
- TextDrawUseBox(txt_Num2, 1);
- TextDrawBoxColor(txt_Num2, -1);
- TextDrawTextSize(txt_Num2, 0.000000, 29.000000);
- txt_Num3 = TextDrawCreate(338.000000, 155.000000, "");
- TextDrawAlignment(txt_Num3, 2);
- TextDrawBackgroundColor(txt_Num3, 255);
- TextDrawFont(txt_Num3, 1);
- TextDrawLetterSize(txt_Num3, 0.500000, 2.000000);
- TextDrawColor(txt_Num3, 16711935);
- TextDrawSetOutline(txt_Num3, 0);
- TextDrawSetProportional(txt_Num3, 1);
- TextDrawSetShadow(txt_Num3, 1);
- TextDrawUseBox(txt_Num3, 1);
- TextDrawBoxColor(txt_Num3, -1);
- TextDrawTextSize(txt_Num3, 0.000000, 29.000000);
- txt_E = TextDrawCreate(251.000000, 172.000000, "&");
- TextDrawBackgroundColor(txt_E, 255);
- TextDrawFont(txt_E, 1);
- TextDrawLetterSize(txt_E, 0.609999, 2.200000);
- TextDrawColor(txt_E, -65281);
- TextDrawSetOutline(txt_E, 1);
- TextDrawSetProportional(txt_E, 1);
- return 1;
- }
- public OnFilterScriptExit()
- {
- TextDrawDestroy(txt_GrattaVinci);
- TextDrawDestroy(txt_Block1);
- TextDrawDestroy(txt_Block2);
- TextDrawDestroy(txt_Block3);
- TextDrawDestroy(txt_Num1);
- TextDrawDestroy(txt_Num2);
- TextDrawDestroy(txt_Num3);
- TextDrawDestroy(txt_E);
- return 1;
- }
- COMMAND:grattaevinci(playerid,params[])
- {
- SetTimer("GrattaVinciEnter", 500, 0);
- SetTimer("Num_1", 3500, 0);
- SetTimer("Num_2", 6500, 0);
- SetTimer("Num_3", 9500, 0);
- SetTimer("GrattaVinciFinished", 14000, 0);
- SetTimer("GrattaVinciExit", 15000, 0);
- return 1;
- }
- public GrattaVinciEnter(playerid)
- {
- SendClientMessage(playerid, COLOR_INFO,"[Info:] Hai ricevuto un Gratta & Vinci");
- TextDrawShowForPlayer(playerid, txt_GrattaVinci);
- TextDrawShowForPlayer(playerid, txt_Block1);
- TextDrawShowForPlayer(playerid, txt_Block2);
- TextDrawShowForPlayer(playerid, txt_Block3);
- TextDrawShowForPlayer(playerid, txt_E);
- return 1;
- }
- public Num_1(playerid)
- {
- SendClientMessage(playerid, COLOR_INFO,"[Info:] Hai grattato la prima casella");
- TextDrawHideForPlayer(playerid, txt_Block1);
- TextDrawShowForPlayer(playerid, txt_Num1);
- TextDrawSetString(txt_Num1, RandomNums[random(sizeof(RandomNums))]);
- return 1;
- }
- public Num_2(playerid)
- {
- SendClientMessage(playerid, COLOR_INFO,"[Info:] Hai grattato la seconda casella");
- TextDrawHideForPlayer(playerid, txt_Block2);
- TextDrawShowForPlayer(playerid, txt_Num2);
- TextDrawSetString(txt_Num2, RandomNums[random(sizeof(RandomNums))]);
- return 1;
- }
- public Num_3(playerid)
- {
- SendClientMessage(playerid, COLOR_INFO,"[Info:] Hai grattato la terza casella");
- TextDrawHideForPlayer(playerid, txt_Block3);
- TextDrawShowForPlayer(playerid, txt_Num3);
- TextDrawSetString(txt_Num3, RandomNums[random(sizeof(RandomNums))]);
- return 1;
- }
- public GrattaVinciFinished(playerid)
- {
- if((txt_Num1, txt_Num2 = txt_Num3))
- {
- SendClientMessage(playerid, COLOR_INFO, "Hai Vinto");
- }
- return 1;
- }
- public GrattaVinciExit(playerid)
- {
- TextDrawHideForPlayer(playerid, txt_GrattaVinci);
- TextDrawHideForPlayer(playerid, txt_Num1);
- TextDrawHideForPlayer(playerid, txt_Num2);
- TextDrawHideForPlayer(playerid, txt_Num3);
- TextDrawHideForPlayer(playerid, txt_E);
- return 1;
- }
Add Comment
Please, Sign In to add comment