Advertisement
Pablo_Borsellino

[Include] pEscapemenu

Oct 18th, 2011
467
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 17.39 KB | None | 0 0
  1. /********************************************************** pEscapemenu v1.0 ***
  2. *
  3. * Scriptname:
  4. * -» pEscapemenu
  5. *
  6. * Author:
  7. * -» Pablo_Borsellino
  8. *
  9. * Creation Date:
  10. * -» 18th October 2011
  11. *
  12. * Release Date:
  13. * -» 19th October 2011
  14. *
  15. * Changelog:
  16. * • v1.0 (19.10.2011)
  17. * -» Initial Release
  18. *
  19. * Need to use:
  20. * -» nothing special
  21. *
  22. * Language:
  23. * -» English
  24. *
  25. * Description:
  26. * -» Some Functions to create a Menu like Escape Menu with some dynamic things.
  27. *
  28. * Functions:
  29. * -» OnEscapeMenuInit()
  30. * -» OnEscapeMenuExit()
  31. * -» OnEscapeMenuKeyStateChange(playerid,newkeys);
  32. * -» OnEscapeMenuUpdate(playerid);
  33. * -» OnEscapeMenuDisconnect(playerid);
  34. * -» OnEscapeMenuConnect(playerid);
  35. *
  36. * -» ShowPlayerEscapeMenu(playerid,Title[],Option1[],Option2[],Option3[],Option4[],Option5[],Option6[],Option7[]);
  37. * -» HidePlayerEscapeMenu(playerid);
  38. * -» SetPlayerEscapeMenuOptionText(playerid,OptionID,NewText[]);
  39. * -» RemovePlayerEscapeMenuOption(playerid,OptionID)
  40. *
  41. * If-Queries:
  42. * -» EscapeMenuOpen(playerid)
  43. * -» IsValidEscapeMenuOption(playerid,OptionID)
  44. *
  45. * Public's:
  46. * -» OnPlayerEscapeMenuRowChange(playerid,NewRowID)
  47. * -» OnPlayerEscapeMenuResponse(playerid,SelectedRow)
  48. *
  49. * Credit's:
  50. * -» n/a
  51. *                                           Copyright © 2011 by Pablo_Borsellino
  52. *******************************************************************************/
  53. //__________________________________________________________________Definition's
  54. #define forEx(%0,%1) for(new %1=0;%1<%0;%1++)
  55.  
  56. //_____________________________________________________________________Setting's
  57. #define ESC_SWITCH_SOUND 1056       //Sound that got played if switch Up/Down
  58. #define ESC_MOVE_TIME_DISTANCE 222  //Distance in Milliseconds between Moving
  59. #define ESC_KEY_TO_RESPONSE KEY_SECONDARY_ATTACK   //Key to response the Menu
  60.  
  61. //_____________________________________________________________________Forward's
  62. forward OnPlayerEscapeMenuRowChange(playerid,NewRowID);
  63. forward OnPlayerEscapeMenuResponse(playerid,SelectedRow);
  64.  
  65. //____________________________________________________________________Variable's
  66. new Text:TD_ESC_Menu_Opt_1,
  67.     Text:TD_ESC_Menu_Opt_2,
  68.     Text:TD_ESC_Menu_Opt_3,
  69.     Text:TD_ESC_Menu_Opt_4,
  70.     Text:TD_ESC_Menu_Opt_5,
  71.     Text:TD_ESC_Menu_Opt_6,
  72.     Text:TD_ESC_Menu_Opt_7,
  73.     Text:TD_ESC_Menu_Title,
  74.     Text:TD_ESC_Menu_Backg,
  75.     _ESC_PLAYER_ROW_POSITION[MAX_PLAYERS]=0,
  76.     bool:_ESC_PLAYER_MOVE[MAX_PLAYERS]=true,
  77.     bool:_ESC_PLAYER_SEE_MENU[MAX_PLAYERS]=false,
  78.     bool:_ESC_PLAYER_FUNC_AVAILABLE[MAX_PLAYERS][7];
  79.  
  80. //______________________________________________________________________Public's
  81. OnEscapeMenuInit()
  82. {
  83.     TD_ESC_Menu_Backg=TextDrawCreate(0,0,"Hintergrund");
  84.     TextDrawBackgroundColor(TD_ESC_Menu_Backg,255);
  85.     TextDrawFont(TD_ESC_Menu_Backg,1);
  86.     TextDrawLetterSize(TD_ESC_Menu_Backg,0,51);
  87.     TextDrawColor(TD_ESC_Menu_Backg,-1);
  88.     TextDrawSetOutline(TD_ESC_Menu_Backg,0);
  89.     TextDrawSetProportional(TD_ESC_Menu_Backg,1);
  90.     TextDrawSetShadow(TD_ESC_Menu_Backg,1);
  91.     TextDrawUseBox(TD_ESC_Menu_Backg,1);
  92.     TextDrawBoxColor(TD_ESC_Menu_Backg,255);
  93.     TextDrawTextSize(TD_ESC_Menu_Backg,640,00);
  94.  
  95.     TD_ESC_Menu_Opt_1=TextDrawCreate(319,140,"Forsetzen");
  96.     TextDrawAlignment(TD_ESC_Menu_Opt_1,2);
  97.     TextDrawBackgroundColor(TD_ESC_Menu_Opt_1,255);
  98.     TextDrawFont(TD_ESC_Menu_Opt_1,2);
  99.     TextDrawLetterSize(TD_ESC_Menu_Opt_1,0.75,1.9);
  100.     TextDrawColor(TD_ESC_Menu_Opt_1,-823266817);
  101.     TextDrawSetOutline(TD_ESC_Menu_Opt_1,0);
  102.     TextDrawSetProportional(TD_ESC_Menu_Opt_1,1);
  103.     TextDrawSetShadow(TD_ESC_Menu_Opt_1,0);
  104.  
  105.     TD_ESC_Menu_Opt_2=TextDrawCreate(319,170,"Neues Spiel Starten");
  106.     TextDrawAlignment(TD_ESC_Menu_Opt_2,2);
  107.     TextDrawBackgroundColor(TD_ESC_Menu_Opt_2,255);
  108.     TextDrawFont(TD_ESC_Menu_Opt_2,2);
  109.     TextDrawLetterSize(TD_ESC_Menu_Opt_2,0.75,1.9);
  110.     TextDrawColor(TD_ESC_Menu_Opt_2,1786416127);
  111.     TextDrawSetOutline(TD_ESC_Menu_Opt_2,0);
  112.     TextDrawSetProportional(TD_ESC_Menu_Opt_2,1);
  113.     TextDrawSetShadow(TD_ESC_Menu_Opt_2,0);
  114.  
  115.     TD_ESC_Menu_Opt_3=TextDrawCreate(319,200,"Karte");
  116.     TextDrawAlignment(TD_ESC_Menu_Opt_3,2);
  117.     TextDrawBackgroundColor(TD_ESC_Menu_Opt_3,255);
  118.     TextDrawFont(TD_ESC_Menu_Opt_3,2);
  119.     TextDrawLetterSize(TD_ESC_Menu_Opt_3,0.75,1.9);
  120.     TextDrawColor(TD_ESC_Menu_Opt_3,1786416127);
  121.     TextDrawSetOutline(TD_ESC_Menu_Opt_3,0);
  122.     TextDrawSetProportional(TD_ESC_Menu_Opt_3,1);
  123.     TextDrawSetShadow(TD_ESC_Menu_Opt_3,0);
  124.  
  125.     TD_ESC_Menu_Opt_4=TextDrawCreate(319,230,"Statistik");
  126.     TextDrawAlignment(TD_ESC_Menu_Opt_4,2);
  127.     TextDrawBackgroundColor(TD_ESC_Menu_Opt_4,255);
  128.     TextDrawFont(TD_ESC_Menu_Opt_4,2);
  129.     TextDrawLetterSize(TD_ESC_Menu_Opt_4,0.75,1.9);
  130.     TextDrawColor(TD_ESC_Menu_Opt_4,1786416127);
  131.     TextDrawSetOutline(TD_ESC_Menu_Opt_4,0);
  132.     TextDrawSetProportional(TD_ESC_Menu_Opt_4,1);
  133.     TextDrawSetShadow(TD_ESC_Menu_Opt_4,0);
  134.  
  135.     TD_ESC_Menu_Opt_5=TextDrawCreate(319,260,"Info");
  136.     TextDrawAlignment(TD_ESC_Menu_Opt_5,2);
  137.     TextDrawBackgroundColor(TD_ESC_Menu_Opt_5,255);
  138.     TextDrawFont(TD_ESC_Menu_Opt_5,2);
  139.     TextDrawLetterSize(TD_ESC_Menu_Opt_5,0.75,1.9);
  140.     TextDrawColor(TD_ESC_Menu_Opt_5,1786416127);
  141.     TextDrawSetOutline(TD_ESC_Menu_Opt_5,0);
  142.     TextDrawSetProportional(TD_ESC_Menu_Opt_5,1);
  143.     TextDrawSetShadow(TD_ESC_Menu_Opt_5,0);
  144.  
  145.     TD_ESC_Menu_Opt_6=TextDrawCreate(319,291,"Optionen");
  146.     TextDrawAlignment(TD_ESC_Menu_Opt_6,2);
  147.     TextDrawBackgroundColor(TD_ESC_Menu_Opt_6,255);
  148.     TextDrawFont(TD_ESC_Menu_Opt_6,2);
  149.     TextDrawLetterSize(TD_ESC_Menu_Opt_6,0.75,1.9);
  150.     TextDrawColor(TD_ESC_Menu_Opt_6,1786416127);
  151.     TextDrawSetOutline(TD_ESC_Menu_Opt_6,0);
  152.     TextDrawSetProportional(TD_ESC_Menu_Opt_6,1);
  153.     TextDrawSetShadow(TD_ESC_Menu_Opt_6,0);
  154.  
  155.     TD_ESC_Menu_Opt_7=TextDrawCreate(319,320,"Spiel beenden");
  156.     TextDrawAlignment(TD_ESC_Menu_Opt_7,2);
  157.     TextDrawBackgroundColor(TD_ESC_Menu_Opt_7,255);
  158.     TextDrawFont(TD_ESC_Menu_Opt_7,2);
  159.     TextDrawLetterSize(TD_ESC_Menu_Opt_7,0.75,1.9);
  160.     TextDrawColor(TD_ESC_Menu_Opt_7,1786416127);
  161.     TextDrawSetOutline(TD_ESC_Menu_Opt_7,0);
  162.     TextDrawSetProportional(TD_ESC_Menu_Opt_7,1);
  163.     TextDrawSetShadow(TD_ESC_Menu_Opt_7,0);
  164.  
  165.     TD_ESC_Menu_Title=TextDrawCreate(40,28,"Pausenmenu");
  166.     TextDrawBackgroundColor(TD_ESC_Menu_Title,255);
  167.     TextDrawFont(TD_ESC_Menu_Title,0);
  168.     TextDrawLetterSize(TD_ESC_Menu_Title,1.38,4.2);
  169.     TextDrawColor(TD_ESC_Menu_Title,-823266817);
  170.     TextDrawSetOutline(TD_ESC_Menu_Title,0);
  171.     TextDrawSetProportional(TD_ESC_Menu_Title,1);
  172.     TextDrawSetShadow(TD_ESC_Menu_Title,1);
  173.  
  174.     forEx(MAX_PLAYERS,playerid)
  175.         _ESC_PLAYER_SEE_MENU[playerid]=false;
  176.     return true;
  177. }
  178.  
  179. OnEscapeMenuExit()
  180. {
  181.     TextDrawDestroy(TD_ESC_Menu_Opt_1);
  182.     TextDrawDestroy(TD_ESC_Menu_Opt_2);
  183.     TextDrawDestroy(TD_ESC_Menu_Opt_3);
  184.     TextDrawDestroy(TD_ESC_Menu_Opt_4);
  185.     TextDrawDestroy(TD_ESC_Menu_Opt_5);
  186.     TextDrawDestroy(TD_ESC_Menu_Opt_6);
  187.     TextDrawDestroy(TD_ESC_Menu_Opt_7);
  188.     TextDrawDestroy(TD_ESC_Menu_Title);
  189.     TextDrawDestroy(TD_ESC_Menu_Backg);
  190.     return true;
  191. }
  192.  
  193. OnEscapeMenuConnect(playerid)return _ESC_PLAYER_SEE_MENU[playerid]=false;
  194.  
  195. OnEscapeMenuDisconnect(playerid)return HidePlayerEscapeMenu(playerid);
  196.  
  197. OnEscapeMenuUpdate(playerid)
  198. {
  199.     if(_ESC_PLAYER_SEE_MENU[playerid]==true&&_ESC_PLAYER_MOVE[playerid]==true)
  200.     {
  201.         new Keys,ud,UNUSED_KEY;
  202.         GetPlayerKeys(playerid,Keys,ud,UNUSED_KEY);
  203.         if(ud<0)//Up
  204.         {
  205.             PlayerPlaySound(playerid,ESC_SWITCH_SOUND,0,0,0);
  206.             _ESC_PLAYER_MOVE[playerid]=false;
  207.             SetTimerEx("_ESC_PLAYER_MOVE_TIMER",ESC_MOVE_TIME_DISTANCE,false,"d",playerid);
  208.             _ESC_PLAYER_ROW_POSITION[playerid]--;
  209.             if(_ESC_PLAYER_ROW_POSITION[playerid]<0)_ESC_PLAYER_ROW_POSITION[playerid]=6;
  210.             if(_ESC_PLAYER_FUNC_AVAILABLE[playerid][_ESC_PLAYER_ROW_POSITION[playerid]]==false){
  211.                 _ESC_PLAYER_ROW_POSITION[playerid]=6;
  212.                 if(_ESC_PLAYER_FUNC_AVAILABLE[playerid][_ESC_PLAYER_ROW_POSITION[playerid]]==false){
  213.                     _ESC_PLAYER_ROW_POSITION[playerid]=5;
  214.                     if(_ESC_PLAYER_FUNC_AVAILABLE[playerid][_ESC_PLAYER_ROW_POSITION[playerid]]==false){
  215.                         _ESC_PLAYER_ROW_POSITION[playerid]=4;
  216.                         if(_ESC_PLAYER_FUNC_AVAILABLE[playerid][_ESC_PLAYER_ROW_POSITION[playerid]]==false){
  217.                             _ESC_PLAYER_ROW_POSITION[playerid]=3;
  218.                             if(_ESC_PLAYER_FUNC_AVAILABLE[playerid][_ESC_PLAYER_ROW_POSITION[playerid]]==false){
  219.                                 _ESC_PLAYER_ROW_POSITION[playerid]=2;
  220.             }}}}}
  221.             CallRemoteFunction("OnPlayerEscapeMenuRowChange","dd",playerid,_ESC_PLAYER_ROW_POSITION[playerid]);
  222.             TextDrawColor(TD_ESC_Menu_Opt_1,1786416127);
  223.             TextDrawColor(TD_ESC_Menu_Opt_2,1786416127);
  224.             TextDrawColor(TD_ESC_Menu_Opt_3,1786416127);
  225.             TextDrawColor(TD_ESC_Menu_Opt_4,1786416127);
  226.             TextDrawColor(TD_ESC_Menu_Opt_5,1786416127);
  227.             TextDrawColor(TD_ESC_Menu_Opt_6,1786416127);
  228.             TextDrawColor(TD_ESC_Menu_Opt_7,1786416127);
  229.             if(_ESC_PLAYER_ROW_POSITION[playerid]==0)TextDrawColor(TD_ESC_Menu_Opt_1,-823266817);
  230.             else if(_ESC_PLAYER_ROW_POSITION[playerid]==1)TextDrawColor(TD_ESC_Menu_Opt_2,-823266817);
  231.             else if(_ESC_PLAYER_ROW_POSITION[playerid]==2)TextDrawColor(TD_ESC_Menu_Opt_3,-823266817);
  232.             else if(_ESC_PLAYER_ROW_POSITION[playerid]==3)TextDrawColor(TD_ESC_Menu_Opt_4,-823266817);
  233.             else if(_ESC_PLAYER_ROW_POSITION[playerid]==4)TextDrawColor(TD_ESC_Menu_Opt_5,-823266817);
  234.             else if(_ESC_PLAYER_ROW_POSITION[playerid]==5)TextDrawColor(TD_ESC_Menu_Opt_6,-823266817);
  235.             else if(_ESC_PLAYER_ROW_POSITION[playerid]==6)TextDrawColor(TD_ESC_Menu_Opt_7,-823266817);
  236.         }
  237.         else if(ud>0)//Down
  238.         {
  239.             PlayerPlaySound(playerid,ESC_SWITCH_SOUND,0,0,0);
  240.             _ESC_PLAYER_MOVE[playerid]=false;
  241.             SetTimerEx("_ESC_PLAYER_MOVE_TIMER",ESC_MOVE_TIME_DISTANCE,false,"d",playerid);
  242.             _ESC_PLAYER_ROW_POSITION[playerid]++;
  243.             if(_ESC_PLAYER_ROW_POSITION[playerid]>6)_ESC_PLAYER_ROW_POSITION[playerid]=0;
  244.             if(_ESC_PLAYER_FUNC_AVAILABLE[playerid][_ESC_PLAYER_ROW_POSITION[playerid]]==false)_ESC_PLAYER_ROW_POSITION[playerid]=0;
  245.             CallRemoteFunction("OnPlayerEscapeMenuRowChange","dd",playerid,_ESC_PLAYER_ROW_POSITION[playerid]);
  246.             TextDrawColor(TD_ESC_Menu_Opt_1,1786416127);
  247.             TextDrawColor(TD_ESC_Menu_Opt_2,1786416127);
  248.             TextDrawColor(TD_ESC_Menu_Opt_3,1786416127);
  249.             TextDrawColor(TD_ESC_Menu_Opt_4,1786416127);
  250.             TextDrawColor(TD_ESC_Menu_Opt_5,1786416127);
  251.             TextDrawColor(TD_ESC_Menu_Opt_6,1786416127);
  252.             TextDrawColor(TD_ESC_Menu_Opt_7,1786416127);
  253.             if(_ESC_PLAYER_ROW_POSITION[playerid]==0)TextDrawColor(TD_ESC_Menu_Opt_1,-823266817);
  254.             else if(_ESC_PLAYER_ROW_POSITION[playerid]==1)TextDrawColor(TD_ESC_Menu_Opt_2,-823266817);
  255.             else if(_ESC_PLAYER_ROW_POSITION[playerid]==2)TextDrawColor(TD_ESC_Menu_Opt_3,-823266817);
  256.             else if(_ESC_PLAYER_ROW_POSITION[playerid]==3)TextDrawColor(TD_ESC_Menu_Opt_4,-823266817);
  257.             else if(_ESC_PLAYER_ROW_POSITION[playerid]==4)TextDrawColor(TD_ESC_Menu_Opt_5,-823266817);
  258.             else if(_ESC_PLAYER_ROW_POSITION[playerid]==5)TextDrawColor(TD_ESC_Menu_Opt_6,-823266817);
  259.             else if(_ESC_PLAYER_ROW_POSITION[playerid]==6)TextDrawColor(TD_ESC_Menu_Opt_7,-823266817);
  260.         }
  261.         TextDrawShowForPlayer(playerid,TD_ESC_Menu_Opt_1);
  262.         TextDrawShowForPlayer(playerid,TD_ESC_Menu_Opt_2);
  263.         TextDrawShowForPlayer(playerid,TD_ESC_Menu_Opt_3);
  264.         TextDrawShowForPlayer(playerid,TD_ESC_Menu_Opt_4);
  265.         TextDrawShowForPlayer(playerid,TD_ESC_Menu_Opt_5);
  266.         TextDrawShowForPlayer(playerid,TD_ESC_Menu_Opt_6);
  267.         TextDrawShowForPlayer(playerid,TD_ESC_Menu_Opt_7);
  268.     }
  269.     return true;
  270. }
  271.  
  272. OnEscapeMenuKeyStateChange(playerid,newkeys)
  273. {
  274.     if(newkeys&KEY_SECONDARY_ATTACK&&_ESC_PLAYER_SEE_MENU[playerid]==true)
  275.         _ESC_OnResponse(playerid,(_ESC_PLAYER_ROW_POSITION[playerid]+1));
  276.     return true;
  277. }
  278.  
  279. //__________________________________________________________________New Public's
  280. forward _ESC_PLAYER_MOVE_TIMER(playerid);
  281. public _ESC_PLAYER_MOVE_TIMER(playerid)return _ESC_PLAYER_MOVE[playerid]=true;
  282.  
  283. //_______________________________________________________________________stock's
  284. stock _ESC_OnResponse(playerid,id)return CallRemoteFunction("OnPlayerEscapeMenuResponse","dd",playerid,id);
  285.  
  286. stock ShowPlayerEscapeMenu(playerid,Title[],Option1[],Option2[],Option3[],Option4[],Option5[],Option6[],Option7[])
  287. {
  288.     _ESC_PLAYER_SEE_MENU[playerid]=true;
  289.     forEx(7,FunctionID)
  290.         _ESC_PLAYER_FUNC_AVAILABLE[playerid][FunctionID]=true;
  291.     forEx(20,ChatLines)
  292.         SendClientMessage(playerid,-1,"");
  293.  
  294.     if(strlen(Title)==0)TextDrawSetString(TD_ESC_Menu_Title,"_");
  295.     else TextDrawSetString(TD_ESC_Menu_Title,Title);
  296.     if(strlen(Option1)==0)
  297.     {
  298.         TextDrawSetString(TD_ESC_Menu_Opt_1,"_");
  299.         _ESC_PLAYER_FUNC_AVAILABLE[playerid][0]=false;
  300.     }
  301.     else TextDrawSetString(TD_ESC_Menu_Opt_1,Option1);
  302.     if(strlen(Option2)==0)
  303.     {
  304.         TextDrawSetString(TD_ESC_Menu_Opt_2,"_");
  305.         _ESC_PLAYER_FUNC_AVAILABLE[playerid][1]=false;
  306.     }
  307.     else TextDrawSetString(TD_ESC_Menu_Opt_2,Option2);
  308.     if(strlen(Option3)==0)
  309.     {
  310.         TextDrawSetString(TD_ESC_Menu_Opt_3,"_");
  311.         _ESC_PLAYER_FUNC_AVAILABLE[playerid][2]=false;
  312.     }
  313.     else TextDrawSetString(TD_ESC_Menu_Opt_3,Option3);
  314.     if(strlen(Option4)==0)
  315.     {
  316.         TextDrawSetString(TD_ESC_Menu_Opt_4,"_");
  317.         _ESC_PLAYER_FUNC_AVAILABLE[playerid][3]=false;
  318.     }
  319.     else TextDrawSetString(TD_ESC_Menu_Opt_4,Option4);
  320.     if(strlen(Option5)==0)
  321.     {
  322.         TextDrawSetString(TD_ESC_Menu_Opt_5,"_");
  323.         _ESC_PLAYER_FUNC_AVAILABLE[playerid][4]=false;
  324.     }
  325.     else TextDrawSetString(TD_ESC_Menu_Opt_5,Option5);
  326.     if(strlen(Option6)==0)
  327.     {
  328.         TextDrawSetString(TD_ESC_Menu_Opt_6,"_");
  329.         _ESC_PLAYER_FUNC_AVAILABLE[playerid][5]=false;
  330.     }
  331.     else TextDrawSetString(TD_ESC_Menu_Opt_6,Option6);
  332.     if(strlen(Option7)==0)
  333.     {
  334.         TextDrawSetString(TD_ESC_Menu_Opt_7,"_");
  335.         _ESC_PLAYER_FUNC_AVAILABLE[playerid][6]=false;
  336.     }
  337.     else TextDrawSetString(TD_ESC_Menu_Opt_7,Option7);
  338.     TextDrawShowForPlayer(playerid,TD_ESC_Menu_Backg);
  339.     TextDrawShowForPlayer(playerid,TD_ESC_Menu_Opt_1);
  340.     TextDrawShowForPlayer(playerid,TD_ESC_Menu_Opt_2);
  341.     TextDrawShowForPlayer(playerid,TD_ESC_Menu_Opt_3);
  342.     TextDrawShowForPlayer(playerid,TD_ESC_Menu_Opt_4);
  343.     TextDrawShowForPlayer(playerid,TD_ESC_Menu_Opt_5);
  344.     TextDrawShowForPlayer(playerid,TD_ESC_Menu_Opt_6);
  345.     TextDrawShowForPlayer(playerid,TD_ESC_Menu_Opt_7);
  346.     TextDrawShowForPlayer(playerid,TD_ESC_Menu_Title);
  347. }
  348.  
  349. stock HidePlayerEscapeMenu(playerid)
  350. {
  351.     if(_ESC_PLAYER_SEE_MENU[playerid]==false)return true;
  352.     _ESC_PLAYER_SEE_MENU[playerid]=false;
  353.     _ESC_PLAYER_ROW_POSITION[playerid]=0;
  354.     TextDrawColor(TD_ESC_Menu_Opt_1,-823266817);
  355.     TextDrawColor(TD_ESC_Menu_Opt_2,1786416127);
  356.     TextDrawColor(TD_ESC_Menu_Opt_3,1786416127);
  357.     TextDrawColor(TD_ESC_Menu_Opt_4,1786416127);
  358.     TextDrawColor(TD_ESC_Menu_Opt_5,1786416127);
  359.     TextDrawColor(TD_ESC_Menu_Opt_6,1786416127);
  360.     TextDrawColor(TD_ESC_Menu_Opt_7,1786416127);
  361.     TextDrawHideForPlayer(playerid,TD_ESC_Menu_Backg);
  362.     TextDrawHideForPlayer(playerid,TD_ESC_Menu_Opt_1);
  363.     TextDrawHideForPlayer(playerid,TD_ESC_Menu_Opt_2);
  364.     TextDrawHideForPlayer(playerid,TD_ESC_Menu_Opt_3);
  365.     TextDrawHideForPlayer(playerid,TD_ESC_Menu_Opt_4);
  366.     TextDrawHideForPlayer(playerid,TD_ESC_Menu_Opt_5);
  367.     TextDrawHideForPlayer(playerid,TD_ESC_Menu_Opt_6);
  368.     TextDrawHideForPlayer(playerid,TD_ESC_Menu_Opt_7);
  369.     TextDrawHideForPlayer(playerid,TD_ESC_Menu_Title);
  370.     return true;
  371. }
  372.  
  373. stock EscapeMenuOpen(playerid)return _ESC_PLAYER_SEE_MENU[playerid];
  374.  
  375. stock SetPlayerEscapeMenuOptionText(playerid,OptionID,NewText[])
  376. {
  377.     if(_ESC_PLAYER_SEE_MENU[playerid]==false)return true;
  378.     if(OptionID<=1){
  379.         TextDrawSetString(TD_ESC_Menu_Opt_1,NewText);
  380.         _ESC_PLAYER_FUNC_AVAILABLE[playerid][0]=true;
  381.         TextDrawShowForPlayer(playerid,TD_ESC_Menu_Opt_1);
  382.     }else if(OptionID==2){
  383.         TextDrawSetString(TD_ESC_Menu_Opt_2,NewText);
  384.         _ESC_PLAYER_FUNC_AVAILABLE[playerid][1]=true;
  385.         TextDrawShowForPlayer(playerid,TD_ESC_Menu_Opt_2);
  386.     }else if(OptionID==3){
  387.         TextDrawSetString(TD_ESC_Menu_Opt_3,NewText);
  388.         _ESC_PLAYER_FUNC_AVAILABLE[playerid][2]=true;
  389.         TextDrawShowForPlayer(playerid,TD_ESC_Menu_Opt_3);
  390.     }else if(OptionID==4){
  391.         TextDrawSetString(TD_ESC_Menu_Opt_4,NewText);
  392.         _ESC_PLAYER_FUNC_AVAILABLE[playerid][3]=true;
  393.         TextDrawShowForPlayer(playerid,TD_ESC_Menu_Opt_4);
  394.     }else if(OptionID==5){
  395.         TextDrawSetString(TD_ESC_Menu_Opt_5,NewText);
  396.         _ESC_PLAYER_FUNC_AVAILABLE[playerid][4]=true;
  397.         TextDrawShowForPlayer(playerid,TD_ESC_Menu_Opt_5);
  398.     }else if(OptionID==6){
  399.         TextDrawSetString(TD_ESC_Menu_Opt_6,NewText);
  400.         _ESC_PLAYER_FUNC_AVAILABLE[playerid][5]=true;
  401.         TextDrawShowForPlayer(playerid,TD_ESC_Menu_Opt_6);
  402.     }else{
  403.         TextDrawSetString(TD_ESC_Menu_Opt_7,NewText);
  404.         _ESC_PLAYER_FUNC_AVAILABLE[playerid][6]=true;
  405.         TextDrawShowForPlayer(playerid,TD_ESC_Menu_Opt_7);
  406.     }
  407.     return true;
  408. }
  409.  
  410. stock RemovePlayerEscapeMenuOption(playerid,OptionID)
  411. {
  412.     if(_ESC_PLAYER_SEE_MENU[playerid]==false)return true;
  413.     if(OptionID<=1){
  414.         TextDrawSetString(TD_ESC_Menu_Opt_1,NewText);
  415.         _ESC_PLAYER_FUNC_AVAILABLE[playerid][0]=false;
  416.     }else if(OptionID==2){
  417.         TextDrawSetString(TD_ESC_Menu_Opt_2,NewText);
  418.         _ESC_PLAYER_FUNC_AVAILABLE[playerid][1]=false;
  419.     }else if(OptionID==3){
  420.         TextDrawSetString(TD_ESC_Menu_Opt_3,NewText);
  421.         _ESC_PLAYER_FUNC_AVAILABLE[playerid][2]=false;
  422.     }else if(OptionID==4){
  423.         TextDrawSetString(TD_ESC_Menu_Opt_4,NewText);
  424.         _ESC_PLAYER_FUNC_AVAILABLE[playerid][3]=false;
  425.     }else if(OptionID==5){
  426.         TextDrawSetString(TD_ESC_Menu_Opt_5,NewText);
  427.         _ESC_PLAYER_FUNC_AVAILABLE[playerid][4]=false;
  428.     }else if(OptionID==6){
  429.         TextDrawSetString(TD_ESC_Menu_Opt_6,NewText);
  430.         _ESC_PLAYER_FUNC_AVAILABLE[playerid][5]=false;
  431.     }else{
  432.          TextDrawSetString(TD_ESC_Menu_Opt_7,NewText);
  433.         _ESC_PLAYER_FUNC_AVAILABLE[playerid][6]=false;
  434.     }
  435.     return true;
  436. }
  437.  
  438. stock IsValidEscapeMenuOption(playerid,OptionID)return _ESC_PLAYER_FUNC_AVAILABLE[playerid][OptionID];
  439.  
  440.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement