Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Made by Lokii.
- #include <YSI\y_hooks> //credits to y_less
- /*
- native HidePlayerMenu(playerid);
- native ShowPlayerMenu(playerid, header[], item1[], item2[], item3[], item4[], item5[], item6[], item7[], item8[], item9[],item10[], item11[], item12[], item13[], item14[], item15[], info[], main_box_color, header_box_color, info_box_color);
- native IsPlayerMenuActive(playerid);
- */
- new PlayerText:E_P_MENU[MAX_PLAYERS][20];
- hook OnPlayerDisconnect(playerid, reason)
- {
- if(IsPlayerNPC(playerid)) return 1;
- HidePlayerMenu(playerid);
- return 1;
- }
- stock HidePlayerMenu(playerid)
- {
- if(IsPlayerNPC(playerid)) return 0;
- if(GetPVarInt(playerid, "L_MENU_ON") == 1)
- {
- for(new i = 0; i < 20; i++)
- {
- PlayerTextDrawHide(playerid, E_P_MENU[playerid][i]);
- PlayerTextDrawDestroy(playerid, E_P_MENU[playerid][i]);
- }
- SetPVarInt(playerid, "L_MENU_ON", 0);
- }
- return 1;
- }
- stock IsPlayerMenuActive(playerid)
- {
- if(GetPVarInt(playerid, "L_MENU_ON") == 0) return 0;
- return 1;
- }
- stock ShowPlayerMenu(playerid, header[], item1[], item2[], item3[], item4[], item5[], item6[], item7[], item8[], item9[],
- item10[], item11[], item12[], item13[], item14[], item15[], info[], main_box_color, header_box_color, info_box_color)
- {
- if(IsPlayerNPC(playerid)) return 0;
- if(GetPVarInt(playerid, "L_MENU_ON") == 0)
- {
- for(new i = 0; i < 20; i++)
- {
- E_P_MENU[playerid][i] = PlayerText:INVALID_TEXT_DRAW;
- }
- E_P_MENU[playerid][0] = CreatePlayerTextDraw(playerid, 9.666687, 113.674041, "box");
- PlayerTextDrawLetterSize(playerid, E_P_MENU[playerid][0], 0.000000, 25.233335);
- PlayerTextDrawTextSize(playerid, E_P_MENU[playerid][0], 263.000000, 0.000000);
- PlayerTextDrawAlignment(playerid, E_P_MENU[playerid][0], 1);
- PlayerTextDrawColor(playerid, E_P_MENU[playerid][0], -1);
- PlayerTextDrawUseBox(playerid, E_P_MENU[playerid][0], 1);
- PlayerTextDrawBoxColor(playerid, E_P_MENU[playerid][0], main_box_color);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][0], 0);
- PlayerTextDrawSetOutline(playerid, E_P_MENU[playerid][0], 0);
- PlayerTextDrawBackgroundColor(playerid, E_P_MENU[playerid][0], 255);
- PlayerTextDrawFont(playerid, E_P_MENU[playerid][0], 1);
- PlayerTextDrawSetProportional(playerid, E_P_MENU[playerid][0], 1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][0], 0);
- E_P_MENU[playerid][1] = CreatePlayerTextDraw(playerid, 10.000020, 138.118667, "box");
- PlayerTextDrawLetterSize(playerid, E_P_MENU[playerid][1], 0.000000, 0.366666);
- PlayerTextDrawTextSize(playerid, E_P_MENU[playerid][1], 262.880706, 0.000000);
- PlayerTextDrawAlignment(playerid, E_P_MENU[playerid][1], 1);
- PlayerTextDrawColor(playerid, E_P_MENU[playerid][1], -1);
- PlayerTextDrawUseBox(playerid, E_P_MENU[playerid][1], 1);
- PlayerTextDrawBoxColor(playerid, E_P_MENU[playerid][1], header_box_color);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][1], 0);
- PlayerTextDrawSetOutline(playerid, E_P_MENU[playerid][1], 0);
- PlayerTextDrawBackgroundColor(playerid, E_P_MENU[playerid][1], 255);
- PlayerTextDrawFont(playerid, E_P_MENU[playerid][1], 1);
- PlayerTextDrawSetProportional(playerid, E_P_MENU[playerid][1], 1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][1], 0);
- E_P_MENU[playerid][2] = CreatePlayerTextDraw(playerid, 9.666693, 112.014816, header);
- PlayerTextDrawLetterSize(playerid, E_P_MENU[playerid][2], 0.444666, 2.570666);
- PlayerTextDrawAlignment(playerid, E_P_MENU[playerid][2], 1);
- PlayerTextDrawColor(playerid, E_P_MENU[playerid][2], -1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][2], 0);
- PlayerTextDrawSetOutline(playerid, E_P_MENU[playerid][2], 0);
- PlayerTextDrawBackgroundColor(playerid, E_P_MENU[playerid][2], 255);
- PlayerTextDrawFont(playerid, E_P_MENU[playerid][2], 1);
- PlayerTextDrawSetProportional(playerid, E_P_MENU[playerid][2], 1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][2], 0);
- E_P_MENU[playerid][3] = CreatePlayerTextDraw(playerid, 10.000020, 326.520568, "box");
- PlayerTextDrawLetterSize(playerid, E_P_MENU[playerid][3], 0.000000, 0.366666);
- PlayerTextDrawTextSize(playerid, E_P_MENU[playerid][3], 262.880706, 0.000000);
- PlayerTextDrawAlignment(playerid, E_P_MENU[playerid][3], 1);
- PlayerTextDrawColor(playerid, E_P_MENU[playerid][3], -1);
- PlayerTextDrawUseBox(playerid, E_P_MENU[playerid][3], 1);
- PlayerTextDrawBoxColor(playerid, E_P_MENU[playerid][3], info_box_color);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][3], 0);
- PlayerTextDrawSetOutline(playerid, E_P_MENU[playerid][3], 0);
- PlayerTextDrawBackgroundColor(playerid, E_P_MENU[playerid][3], 255);
- PlayerTextDrawFont(playerid, E_P_MENU[playerid][3], 1);
- PlayerTextDrawSetProportional(playerid, E_P_MENU[playerid][3], 1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][3], 0);
- E_P_MENU[playerid][4] = CreatePlayerTextDraw(playerid, 9.666692, 331.866821, info);
- PlayerTextDrawLetterSize(playerid, E_P_MENU[playerid][4], 0.293666, 0.915554);
- PlayerTextDrawAlignment(playerid, E_P_MENU[playerid][4], 1);
- PlayerTextDrawColor(playerid, E_P_MENU[playerid][4], -1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][4], 0);
- PlayerTextDrawSetOutline(playerid, E_P_MENU[playerid][4], 0);
- PlayerTextDrawBackgroundColor(playerid, E_P_MENU[playerid][4], 255);
- PlayerTextDrawFont(playerid, E_P_MENU[playerid][4], 1);
- PlayerTextDrawSetProportional(playerid, E_P_MENU[playerid][4], 1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][4], 0);
- E_P_MENU[playerid][5] = CreatePlayerTextDraw(playerid, 9.000021, 145.200088, item1);
- PlayerTextDrawLetterSize(playerid, E_P_MENU[playerid][5], 0.274333, 1.039998);
- PlayerTextDrawAlignment(playerid, E_P_MENU[playerid][5], 1);
- PlayerTextDrawColor(playerid, E_P_MENU[playerid][5], -1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][5], 0);
- PlayerTextDrawSetOutline(playerid, E_P_MENU[playerid][5], 0);
- PlayerTextDrawBackgroundColor(playerid, E_P_MENU[playerid][5], 255);
- PlayerTextDrawFont(playerid, E_P_MENU[playerid][5], 1);
- PlayerTextDrawSetProportional(playerid, E_P_MENU[playerid][5], 1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][5], 0);
- E_P_MENU[playerid][6] = CreatePlayerTextDraw(playerid, 9.000021, 155.400192, item2);
- PlayerTextDrawLetterSize(playerid, E_P_MENU[playerid][6], 0.274333, 1.039998);
- PlayerTextDrawAlignment(playerid, E_P_MENU[playerid][6], 1);
- PlayerTextDrawColor(playerid, E_P_MENU[playerid][6], -1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][6], 0);
- PlayerTextDrawSetOutline(playerid, E_P_MENU[playerid][6], 0);
- PlayerTextDrawBackgroundColor(playerid, E_P_MENU[playerid][6], 255);
- PlayerTextDrawFont(playerid, E_P_MENU[playerid][6], 1);
- PlayerTextDrawSetProportional(playerid, E_P_MENU[playerid][6], 1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][6], 0);
- E_P_MENU[playerid][7] = CreatePlayerTextDraw(playerid, 9.000021, 165.600296, item3);
- PlayerTextDrawLetterSize(playerid, E_P_MENU[playerid][7], 0.274333, 1.039998);
- PlayerTextDrawAlignment(playerid, E_P_MENU[playerid][7], 1);
- PlayerTextDrawColor(playerid, E_P_MENU[playerid][7], -1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][7], 0);
- PlayerTextDrawSetOutline(playerid, E_P_MENU[playerid][7], 0);
- PlayerTextDrawBackgroundColor(playerid, E_P_MENU[playerid][7], 255);
- PlayerTextDrawFont(playerid, E_P_MENU[playerid][7], 1);
- PlayerTextDrawSetProportional(playerid, E_P_MENU[playerid][7], 1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][7], 0);
- E_P_MENU[playerid][8] = CreatePlayerTextDraw(playerid, 9.000021, 175.800399, item4);
- PlayerTextDrawLetterSize(playerid, E_P_MENU[playerid][8], 0.274333, 1.039998);
- PlayerTextDrawAlignment(playerid, E_P_MENU[playerid][8], 1);
- PlayerTextDrawColor(playerid, E_P_MENU[playerid][8], -1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][8], 0);
- PlayerTextDrawSetOutline(playerid, E_P_MENU[playerid][8], 0);
- PlayerTextDrawBackgroundColor(playerid, E_P_MENU[playerid][8], 255);
- PlayerTextDrawFont(playerid, E_P_MENU[playerid][8], 1);
- PlayerTextDrawSetProportional(playerid, E_P_MENU[playerid][8], 1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][8], 0);
- E_P_MENU[playerid][9] = CreatePlayerTextDraw(playerid, 9.000021, 186.600509, item5);
- PlayerTextDrawLetterSize(playerid, E_P_MENU[playerid][9], 0.274333, 1.039998);
- PlayerTextDrawAlignment(playerid, E_P_MENU[playerid][9], 1);
- PlayerTextDrawColor(playerid, E_P_MENU[playerid][9], -1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][9], 0);
- PlayerTextDrawSetOutline(playerid, E_P_MENU[playerid][9], 0);
- PlayerTextDrawBackgroundColor(playerid, E_P_MENU[playerid][9], 255);
- PlayerTextDrawFont(playerid, E_P_MENU[playerid][9], 1);
- PlayerTextDrawSetProportional(playerid, E_P_MENU[playerid][9], 1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][9], 0);
- E_P_MENU[playerid][10] = CreatePlayerTextDraw(playerid, 9.000021, 198.600631, item6);
- PlayerTextDrawLetterSize(playerid, E_P_MENU[playerid][10], 0.274333, 1.039998);
- PlayerTextDrawAlignment(playerid, E_P_MENU[playerid][10], 1);
- PlayerTextDrawColor(playerid, E_P_MENU[playerid][10], -1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][10], 0);
- PlayerTextDrawSetOutline(playerid, E_P_MENU[playerid][10], 0);
- PlayerTextDrawBackgroundColor(playerid, E_P_MENU[playerid][10], 255);
- PlayerTextDrawFont(playerid, E_P_MENU[playerid][10], 1);
- PlayerTextDrawSetProportional(playerid, E_P_MENU[playerid][10], 1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][10], 0);
- E_P_MENU[playerid][11] = CreatePlayerTextDraw(playerid, 9.000021, 211.200759, item7);
- PlayerTextDrawLetterSize(playerid, E_P_MENU[playerid][11], 0.274333, 1.039998);
- PlayerTextDrawAlignment(playerid, E_P_MENU[playerid][11], 1);
- PlayerTextDrawColor(playerid, E_P_MENU[playerid][11], -1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][11], 0);
- PlayerTextDrawSetOutline(playerid, E_P_MENU[playerid][11], 0);
- PlayerTextDrawBackgroundColor(playerid, E_P_MENU[playerid][11], 255);
- PlayerTextDrawFont(playerid, E_P_MENU[playerid][11], 1);
- PlayerTextDrawSetProportional(playerid, E_P_MENU[playerid][11], 1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][11], 0);
- E_P_MENU[playerid][12] = CreatePlayerTextDraw(playerid, 9.000021, 224.400894, item8);
- PlayerTextDrawLetterSize(playerid, E_P_MENU[playerid][12], 0.274333, 1.039998);
- PlayerTextDrawAlignment(playerid, E_P_MENU[playerid][12], 1);
- PlayerTextDrawColor(playerid, E_P_MENU[playerid][12], -1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][12], 0);
- PlayerTextDrawSetOutline(playerid, E_P_MENU[playerid][12], 0);
- PlayerTextDrawBackgroundColor(playerid, E_P_MENU[playerid][12], 255);
- PlayerTextDrawFont(playerid, E_P_MENU[playerid][12], 1);
- PlayerTextDrawSetProportional(playerid, E_P_MENU[playerid][12], 1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][12], 0);
- E_P_MENU[playerid][13] = CreatePlayerTextDraw(playerid, 9.000021, 236.401016, item9);
- PlayerTextDrawLetterSize(playerid, E_P_MENU[playerid][13], 0.274333, 1.039998);
- PlayerTextDrawAlignment(playerid, E_P_MENU[playerid][13], 1);
- PlayerTextDrawColor(playerid, E_P_MENU[playerid][13], -1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][13], 0);
- PlayerTextDrawSetOutline(playerid, E_P_MENU[playerid][13], 0);
- PlayerTextDrawBackgroundColor(playerid, E_P_MENU[playerid][13], 255);
- PlayerTextDrawFont(playerid, E_P_MENU[playerid][13], 1);
- PlayerTextDrawSetProportional(playerid, E_P_MENU[playerid][13], 1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][13], 0);
- E_P_MENU[playerid][14] = CreatePlayerTextDraw(playerid, 9.000021, 248.401138, item10);
- PlayerTextDrawLetterSize(playerid, E_P_MENU[playerid][14], 0.274333, 1.039998);
- PlayerTextDrawAlignment(playerid, E_P_MENU[playerid][14], 1);
- PlayerTextDrawColor(playerid, E_P_MENU[playerid][14], -1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][14], 0);
- PlayerTextDrawSetOutline(playerid, E_P_MENU[playerid][14], 0);
- PlayerTextDrawBackgroundColor(playerid, E_P_MENU[playerid][14], 255);
- PlayerTextDrawFont(playerid, E_P_MENU[playerid][14], 1);
- PlayerTextDrawSetProportional(playerid, E_P_MENU[playerid][14], 1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][14], 0);
- E_P_MENU[playerid][15] = CreatePlayerTextDraw(playerid, 9.000021, 261.001251, item11);
- PlayerTextDrawLetterSize(playerid, E_P_MENU[playerid][15], 0.274333, 1.039998);
- PlayerTextDrawAlignment(playerid, E_P_MENU[playerid][15], 1);
- PlayerTextDrawColor(playerid, E_P_MENU[playerid][15], -1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][15], 0);
- PlayerTextDrawSetOutline(playerid, E_P_MENU[playerid][15], 0);
- PlayerTextDrawBackgroundColor(playerid, E_P_MENU[playerid][15], 255);
- PlayerTextDrawFont(playerid, E_P_MENU[playerid][15], 1);
- PlayerTextDrawSetProportional(playerid, E_P_MENU[playerid][15], 1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][15], 0);
- E_P_MENU[playerid][16] = CreatePlayerTextDraw(playerid, 9.000021, 274.201385, item12);
- PlayerTextDrawLetterSize(playerid, E_P_MENU[playerid][16], 0.274333, 1.039998);
- PlayerTextDrawAlignment(playerid, E_P_MENU[playerid][16], 1);
- PlayerTextDrawColor(playerid, E_P_MENU[playerid][16], -1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][16], 0);
- PlayerTextDrawSetOutline(playerid, E_P_MENU[playerid][16], 0);
- PlayerTextDrawBackgroundColor(playerid, E_P_MENU[playerid][16], 255);
- PlayerTextDrawFont(playerid, E_P_MENU[playerid][16], 1);
- PlayerTextDrawSetProportional(playerid, E_P_MENU[playerid][16], 1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][16], 0);
- E_P_MENU[playerid][17] = CreatePlayerTextDraw(playerid, 9.000021, 287.401519, item13);
- PlayerTextDrawLetterSize(playerid, E_P_MENU[playerid][17], 0.274333, 1.039998);
- PlayerTextDrawAlignment(playerid, E_P_MENU[playerid][17], 1);
- PlayerTextDrawColor(playerid, E_P_MENU[playerid][17], -1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][17], 0);
- PlayerTextDrawSetOutline(playerid, E_P_MENU[playerid][17], 0);
- PlayerTextDrawBackgroundColor(playerid, E_P_MENU[playerid][17], 255);
- PlayerTextDrawFont(playerid, E_P_MENU[playerid][17], 1);
- PlayerTextDrawSetProportional(playerid, E_P_MENU[playerid][17], 1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][17], 0);
- E_P_MENU[playerid][18] = CreatePlayerTextDraw(playerid, 9.000021, 300.601654, item14);
- PlayerTextDrawLetterSize(playerid, E_P_MENU[playerid][18], 0.274333, 1.039998);
- PlayerTextDrawAlignment(playerid, E_P_MENU[playerid][18], 1);
- PlayerTextDrawColor(playerid, E_P_MENU[playerid][18], -1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][18], 0);
- PlayerTextDrawSetOutline(playerid, E_P_MENU[playerid][18], 0);
- PlayerTextDrawBackgroundColor(playerid, E_P_MENU[playerid][18], 255);
- PlayerTextDrawFont(playerid, E_P_MENU[playerid][18], 1);
- PlayerTextDrawSetProportional(playerid, E_P_MENU[playerid][18], 1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][18], 0);
- E_P_MENU[playerid][19] = CreatePlayerTextDraw(playerid, 9.000021, 313.801788, item15);
- PlayerTextDrawLetterSize(playerid, E_P_MENU[playerid][19], 0.274333, 1.039998);
- PlayerTextDrawAlignment(playerid, E_P_MENU[playerid][19], 1);
- PlayerTextDrawColor(playerid, E_P_MENU[playerid][19], -1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][19], 0);
- PlayerTextDrawSetOutline(playerid, E_P_MENU[playerid][19], 0);
- PlayerTextDrawBackgroundColor(playerid, E_P_MENU[playerid][19], 255);
- PlayerTextDrawFont(playerid, E_P_MENU[playerid][19], 1);
- PlayerTextDrawSetProportional(playerid, E_P_MENU[playerid][19], 1);
- PlayerTextDrawSetShadow(playerid, E_P_MENU[playerid][19], 0);
- for(new i = 0; i < 20; i++)
- {
- PlayerTextDrawShow(playerid, E_P_MENU[playerid][i]);
- }
- SetPVarInt(playerid, "L_MENU_ON", 1);
- }
- return 1;
- }
- forward OnPlayerMenuResponse(playerid, choice);
- forward OnPlayerMenuClose(playerid);
- hook OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(newkeys & KEY_FIRE)
- {
- if(GetPVarInt(playerid, "L_MENU_ON") == 1)
- {
- HidePlayerMenu(playerid);
- CallLocalFunction("OnPlayerMenuClose", "i", playerid);
- }
- }
- return 1;
- }
- IsNum(const string[])
- {
- for(new b = 0; b < strlen(string); b++)
- {
- if(string[b] < '0' || string[b] > '9') return 0;
- }
- return 1;
- }
- hook OnPlayerText(playerid, text[])
- {
- if(GetPVarInt(playerid, "L_MENU_ON") == 1)
- {
- if(IsNum(text))
- {
- CallLocalFunction("OnPlayerMenuResponse", "ii", playerid, strval(text));
- }
- return 0;
- }
- return 1;
- }
- #if defined FILTERSCRIPT
- hook OnFilterScriptInit()
- {
- for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
- {
- if(!IsPlayerConnected(i) || IsPlayerNPC(i)) continue;
- HidePlayerMenu(i);
- }
- return 1;
- }
- #else
- hook OnGameModeInit()
- {
- for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++)
- {
- if(!IsPlayerConnected(i) || IsPlayerNPC(i)) continue;
- HidePlayerMenu(i);
- }
- return 1;
- }
- #endif
- //EOF.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement