Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <YSI\y_hooks>
- new
- Text:fex_TD [ 3 ],
- PlayerText:fex_pTD [ MAX_PLAYERS ] [ 5 ],
- fex_dialogid [ MAX_PLAYERS ]
- ;
- forward OnFexDialogResponse(playerid, dialogid, response);
- hook OnGameModeInit()
- {
- fex_TD [ 0 ] = TextDrawCreate(470.000000, 162.000000, "BG");
- TextDrawBackgroundColor(fex_TD [ 0 ], 255);
- TextDrawFont(fex_TD [ 0 ], 1);
- TextDrawLetterSize(fex_TD [ 0 ], 0.000000, 2.699999);
- TextDrawColor(fex_TD [ 0 ], -1);
- TextDrawSetOutline(fex_TD [ 0 ], 0);
- TextDrawSetProportional(fex_TD [ 0 ], 1);
- TextDrawSetShadow(fex_TD [ 0 ], 1);
- TextDrawUseBox(fex_TD [ 0 ], 1);
- TextDrawBoxColor(fex_TD [ 0 ], 1414812927);
- TextDrawTextSize(fex_TD [ 0 ], 169.000000, 0.000000);
- TextDrawSetSelectable(fex_TD [ 0 ], 0);
- fex_TD [ 1 ] = TextDrawCreate(388.250000, 144.000000, "2");
- TextDrawBackgroundColor(fex_TD [ 1 ], 926956287);
- TextDrawFont(fex_TD [ 1 ], 5);
- TextDrawLetterSize(fex_TD [ 1 ], 0.000000, 1.000000);
- TextDrawColor(fex_TD [ 1 ], -1);
- TextDrawSetOutline(fex_TD [ 1 ], 0);
- TextDrawSetProportional(fex_TD [ 1 ], 1);
- TextDrawSetShadow(fex_TD [ 1 ], 1);
- TextDrawUseBox(fex_TD [ 1 ], 1);
- TextDrawBoxColor(fex_TD [ 1 ], 0);
- TextDrawTextSize(fex_TD [ 1 ], 80.000000, 15.000000);
- TextDrawSetPreviewModel(fex_TD [ 1 ], 1);
- TextDrawSetPreviewRot(fex_TD [ 1 ], -16.000000, 0.000000, -55.000000, -1.000000);
- TextDrawSetSelectable(fex_TD [ 1 ], 1);
- fex_TD [ 2 ] = TextDrawCreate(307.250000, 144.000000, "1");
- TextDrawBackgroundColor(fex_TD [ 2 ], 926956287);
- TextDrawFont(fex_TD [ 2 ], 5);
- TextDrawLetterSize(fex_TD [ 2 ], 0.000000, 1.000000);
- TextDrawColor(fex_TD [ 2 ], -1);
- TextDrawSetOutline(fex_TD [ 2 ], 0);
- TextDrawSetProportional(fex_TD [ 2 ], 1);
- TextDrawSetShadow(fex_TD [ 2 ], 1);
- TextDrawUseBox(fex_TD [ 2 ], 1);
- TextDrawBoxColor(fex_TD [ 2 ], 0);
- TextDrawTextSize(fex_TD [ 2 ], 80.000000, 15.000000);
- TextDrawSetPreviewModel(fex_TD [ 2 ], 1);
- TextDrawSetPreviewRot(fex_TD [ 2 ], -16.000000, 0.000000, -55.000000, -1.000000);
- TextDrawSetSelectable(fex_TD [ 2 ], 1);
- return 1;
- }
- hook OnPlayerConnect(playerid)
- {
- fex_pTD [ playerid ] [ 0 ] = CreatePlayerTextDraw(playerid, 470.000000, 177.000000, "BG");
- PlayerTextDrawBackgroundColor(playerid, fex_pTD [ playerid ] [ 0 ], 255);
- PlayerTextDrawFont(playerid, fex_pTD [ playerid ] [ 0 ], 1);
- PlayerTextDrawLetterSize(playerid, fex_pTD [ playerid ] [ 0 ], 0.000000, 7.500000);
- PlayerTextDrawColor(playerid, fex_pTD [ playerid ] [ 0 ], -1);
- PlayerTextDrawSetOutline(playerid, fex_pTD [ playerid ] [ 0 ], 0);
- PlayerTextDrawSetProportional(playerid, fex_pTD [ playerid ] [ 0 ], 1);
- PlayerTextDrawSetShadow(playerid, fex_pTD [ playerid ] [ 0 ], 1);
- PlayerTextDrawUseBox(playerid, fex_pTD [ playerid ] [ 0 ], 1);
- PlayerTextDrawBoxColor(playerid, fex_pTD [ playerid ] [ 0 ], 656877567);
- PlayerTextDrawTextSize(playerid, fex_pTD [ playerid ] [ 0 ], 169.000000, 0.000000);
- PlayerTextDrawSetSelectable(playerid, fex_pTD [ playerid ] [ 0 ], 0);
- fex_pTD [ playerid ] [ 1 ] = CreatePlayerTextDraw(playerid, 175.000000, 163.000000, "~y~Serverio apklausa");
- PlayerTextDrawBackgroundColor(playerid, fex_pTD [ playerid ] [ 1 ], 656877567);
- PlayerTextDrawFont(playerid, fex_pTD [ playerid ] [ 1 ], 2);
- PlayerTextDrawLetterSize(playerid, fex_pTD [ playerid ] [ 1 ], 0.200000, 1.000000);
- PlayerTextDrawColor(playerid, fex_pTD [ playerid ] [ 1 ], -1);
- PlayerTextDrawSetOutline(playerid, fex_pTD [ playerid ] [ 1 ], 0);
- PlayerTextDrawSetProportional(playerid, fex_pTD [ playerid ] [ 1 ], 1);
- PlayerTextDrawSetShadow(playerid, fex_pTD [ playerid ] [ 1 ], 0);
- PlayerTextDrawSetSelectable(playerid, fex_pTD [ playerid ] [ 1 ], 0);
- fex_pTD [ playerid ] [ 2 ] = CreatePlayerTextDraw(playerid, 319.500000, 193.000000, "wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww~n~wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww~n~wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww~n~wwwwwwwwwwwwwwwwwwww");
- PlayerTextDrawAlignment(playerid, fex_pTD [ playerid ] [ 2 ], 2);
- PlayerTextDrawBackgroundColor(playerid, fex_pTD [ playerid ] [ 2 ], 656877567);
- PlayerTextDrawFont(playerid, fex_pTD [ playerid ] [ 2 ], 2);
- PlayerTextDrawLetterSize(playerid, fex_pTD [ playerid ] [ 2 ], 0.200000, 1.000000);
- PlayerTextDrawColor(playerid, fex_pTD [ playerid ] [ 2 ], -1);
- PlayerTextDrawSetOutline(playerid, fex_pTD [ playerid ] [ 2 ], 0);
- PlayerTextDrawSetProportional(playerid, fex_pTD [ playerid ] [ 2 ], 1);
- PlayerTextDrawSetShadow(playerid, fex_pTD [ playerid ] [ 2 ], 0);
- PlayerTextDrawSetSelectable(playerid, fex_pTD [ playerid ] [ 2 ], 0);
- fex_pTD [ playerid ] [ 3 ] = CreatePlayerTextDraw(playerid, 347.000000, 147.000000, "Taip");
- PlayerTextDrawAlignment(playerid, fex_pTD [ playerid ] [ 3 ], 2);
- PlayerTextDrawBackgroundColor(playerid, fex_pTD [ playerid ] [ 3 ], 656877567);
- PlayerTextDrawFont(playerid, fex_pTD [ playerid ] [ 3 ], 2);
- PlayerTextDrawLetterSize(playerid, fex_pTD [ playerid ] [ 3 ], 0.180000, 0.899999);
- PlayerTextDrawColor(playerid, fex_pTD [ playerid ] [ 3 ], -1);
- PlayerTextDrawSetOutline(playerid, fex_pTD [ playerid ] [ 3 ], 0);
- PlayerTextDrawSetProportional(playerid, fex_pTD [ playerid ] [ 3 ], 1);
- PlayerTextDrawSetShadow(playerid, fex_pTD [ playerid ] [ 3 ], 0);
- PlayerTextDrawSetSelectable(playerid, fex_pTD [ playerid ] [ 3 ], 0);
- fex_pTD [ playerid ] [ 4 ] = CreatePlayerTextDraw(playerid, 428.000000, 147.000000, "Ne");
- PlayerTextDrawAlignment(playerid, fex_pTD [ playerid ] [ 4 ], 2);
- PlayerTextDrawBackgroundColor(playerid, fex_pTD [ playerid ] [ 4 ], 656877567);
- PlayerTextDrawFont(playerid, fex_pTD [ playerid ] [ 4 ], 2);
- PlayerTextDrawLetterSize(playerid, fex_pTD [ playerid ] [ 4 ], 0.180000, 0.899999);
- PlayerTextDrawColor(playerid, fex_pTD [ playerid ] [ 4 ], -1);
- PlayerTextDrawSetOutline(playerid, fex_pTD [ playerid ] [ 4 ], 0);
- PlayerTextDrawSetProportional(playerid, fex_pTD [ playerid ] [ 4 ], 1);
- PlayerTextDrawSetShadow(playerid, fex_pTD [ playerid ] [ 4 ], 0);
- PlayerTextDrawSetSelectable(playerid, fex_pTD [ playerid ] [ 4 ], 0);
- return 1;
- }
- hook OnPlayerClickTextDraw(playerid, Text:clickedid)
- {
- if(clickedid == fex_TD [ 1 ]) CallLocalFunction("OnFexDialogResponse", "iii", playerid, fex_dialogid [ playerid ], 0), HideFexDialog(playerid);
- if(clickedid == fex_TD [ 2 ]) CallLocalFunction("OnFexDialogResponse", "iii", playerid, fex_dialogid [ playerid ], 1), HideFexDialog(playerid);
- return 1;
- }
- stock ShowFexDialog(playerid, dialogid, header[], text[], button1[], button2[])
- {
- if(strlen(header) > 27 || strlen(text) > 135 || strlen(button1) > 10 || strlen(button2) > 10) return SendClientMessage(playerid, -1, "{FF0000}* Blogai suformatuota lentele!");
- new
- str [ 127 ],
- cat [ 54 ],
- Float:pos,
- count
- ;
- switch(strlen(text))
- {
- case 0..45: pos = 4.5, count = 1;
- case 46..90: pos = 5.5, count = 2;
- case 91..135: pos = 6.5, count = 3;
- }
- fex_dialogid [ playerid ] = dialogid, PlayerTextDrawLetterSize(playerid, fex_pTD [ playerid ] [ 0 ], 0.000000, pos); for(new i; i < count; i++) strmid(cat, text, i*45, 45+i*45), format(cat, sizeof cat, "%s~n~", cat), strcat(str, cat);
- PlayerTextDrawSetString(playerid, fex_pTD [ playerid ] [ 2 ], str), format(str, sizeof str, "~y~%s", header), PlayerTextDrawSetString(playerid, fex_pTD [ playerid ] [ 1 ], str), PlayerTextDrawSetString(playerid, fex_pTD [ playerid ] [ 3 ], button1), PlayerTextDrawSetString(playerid, fex_pTD [ playerid ] [ 4 ], button2);
- for(new TD; TD < sizeof fex_TD; TD++) TextDrawShowForPlayer(playerid, fex_TD[TD]);
- for(new TD; TD < 5; TD++) PlayerTextDrawShow(playerid, fex_pTD[playerid][TD]);
- return SelectTextDraw(playerid, 0xFFFFFF75);
- }
- stock HideFexDialog(playerid)
- {
- for(new TD; TD < sizeof fex_TD; TD++) TextDrawHideForPlayer(playerid, fex_TD[TD]);
- for(new TD; TD < 5; TD++) PlayerTextDrawHide(playerid, fex_pTD[playerid][TD]);
- return fex_dialogid [ playerid ] = -1, CancelSelectTextDraw(playerid);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement