Advertisement
Guest User

A_Infobox Include V2

a guest
Jul 15th, 2013
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 5.53 KB | None | 0 0
  1. /*
  2.     Include: A_Infobox
  3.     Include by: Azure
  4.     Version: 2.00
  5.     Release: 15.07.2013
  6.     native InfoText(playerid,overview[50],text[200],time);
  7.     native InfoTextForAll(overview[50],text[200],time);
  8. */
  9. new Text:InfoBoxTextdraw[2];
  10. new Text:InfoBoxPLTextdraw[MAX_PLAYERS][2];
  11. new Text:InfoBoxPLTextdrawAll[MAX_PLAYERS][2];
  12. new bool:InfoTextState[MAX_PLAYERS];
  13. new InfoTextStateAll[MAX_PLAYERS];
  14. new InfoBoxTimer[MAX_PLAYERS];
  15. new InfoBoxTimerAll[MAX_PLAYERS];
  16.  
  17. forward InfoBoxHide(playerid);
  18. forward InfoBoxHideAll();
  19.  
  20. public OnGameModeInit()
  21. {
  22.     InfoBoxTextdraw[0] = TextDrawCreate(630.000000, 350.000000, "~n~~n~~n~~n~~n~~n~~n~~n~");
  23.     TextDrawBackgroundColor(InfoBoxTextdraw[0], 255);
  24.     TextDrawFont(InfoBoxTextdraw[0], 1);
  25.     TextDrawLetterSize(InfoBoxTextdraw[0], 0.500000, 1.000000);
  26.     TextDrawColor(InfoBoxTextdraw[0], 120);
  27.     TextDrawSetOutline(InfoBoxTextdraw[0], 0);
  28.     TextDrawSetProportional(InfoBoxTextdraw[0], 1);
  29.     TextDrawSetShadow(InfoBoxTextdraw[0], 1);
  30.     TextDrawUseBox(InfoBoxTextdraw[0], 1);
  31.     TextDrawBoxColor(InfoBoxTextdraw[0], 336860270);
  32.     TextDrawTextSize(InfoBoxTextdraw[0], 480.000000, 0.000000);
  33.    
  34.     InfoBoxTextdraw[1] = TextDrawCreate(630.000000, 350.000000, "_");
  35.     TextDrawBackgroundColor(InfoBoxTextdraw[1], 255);
  36.     TextDrawFont(InfoBoxTextdraw[1], 1);
  37.     TextDrawLetterSize(InfoBoxTextdraw[1], 0.500000, 1.500000);
  38.     TextDrawColor(InfoBoxTextdraw[1], -1);
  39.     TextDrawSetOutline(InfoBoxTextdraw[1], 0);
  40.     TextDrawSetProportional(InfoBoxTextdraw[1], 1);
  41.     TextDrawSetShadow(InfoBoxTextdraw[1], 1);
  42.     TextDrawUseBox(InfoBoxTextdraw[1], 1);
  43.     TextDrawBoxColor(InfoBoxTextdraw[1], 255);
  44.     TextDrawTextSize(InfoBoxTextdraw[1], 480.000000, 0.000000);
  45.    
  46.     return CallLocalFunction("__OnGameModeInit","");
  47. }
  48. #if defined _ALS_OnGameModeInit
  49.     #undef OnGameModeInit
  50. #else
  51.     #define _ALS_OnGameModeInit
  52. #endif
  53. #define OnGameModeInit __OnGameModeInit
  54. forward __OnGameModeInit();
  55.  
  56. stock InfoTextForAll(overview[50],text[200],time)
  57. {
  58.     for(new i=0; i<MAX_PLAYERS; i++)
  59.     {
  60.         if(!InfoTextStateAll[i] && !InfoTextState[i])
  61.         {
  62.             KillTimer(InfoBoxTimerAll[i]);
  63.             TextDrawShowForPlayer(i,InfoBoxTextdraw[0]);
  64.             TextDrawShowForPlayer(i,InfoBoxTextdraw[1]);
  65.            
  66.             InfoBoxPLTextdrawAll[i][0] = TextDrawCreate(509.000000, 350.000000, overview);
  67.             TextDrawBackgroundColor(InfoBoxPLTextdrawAll[i][0], 255);
  68.             TextDrawFont(InfoBoxPLTextdrawAll[i][0], 2);
  69.             TextDrawLetterSize(InfoBoxPLTextdrawAll[i][0], 0.300000, 1.299998);
  70.             TextDrawColor(InfoBoxPLTextdrawAll[i][0], -65281);
  71.             TextDrawSetOutline(InfoBoxPLTextdrawAll[i][0], 1);
  72.             TextDrawSetProportional(InfoBoxPLTextdrawAll[i][0], 1);
  73.            
  74.             InfoBoxPLTextdrawAll[i][1] = TextDrawCreate(487.000000, 369.000000, text);
  75.             TextDrawBackgroundColor(InfoBoxPLTextdrawAll[i][1], 255);
  76.             TextDrawFont(InfoBoxPLTextdrawAll[i][1], 1);
  77.             TextDrawLetterSize(InfoBoxPLTextdrawAll[i][1], 0.259999, 0.899999);
  78.             TextDrawColor(InfoBoxPLTextdrawAll[i][1], -1);
  79.             TextDrawSetOutline(InfoBoxPLTextdrawAll[i][1], 1);
  80.             TextDrawSetProportional(InfoBoxPLTextdrawAll[i][1], 1);        
  81.            
  82.             TextDrawShowForPlayer(i,InfoBoxPLTextdrawAll[i][0]);
  83.             TextDrawShowForPlayer(i,InfoBoxPLTextdrawAll[i][1]);
  84.             InfoTextStateAll[i]=true;
  85.             InfoBoxTimerAll[i]=SetTimer("InfoBoxHideAll",time,0);
  86.         }
  87.     }
  88. }
  89.  
  90. stock InfoText(playerid,overview[50],text[200],time)
  91. {
  92.     if(!InfoTextState[playerid] && !InfoTextStateAll[playerid])
  93.     {
  94.         KillTimer(InfoBoxTimer[playerid]);
  95.         TextDrawShowForPlayer(playerid,InfoBoxTextdraw[0]);
  96.         TextDrawShowForPlayer(playerid,InfoBoxTextdraw[1]);
  97.  
  98.         InfoBoxPLTextdraw[playerid][0] = TextDrawCreate(509.000000, 350.000000, overview);
  99.         TextDrawBackgroundColor(InfoBoxPLTextdraw[playerid][0], 255);
  100.         TextDrawFont(InfoBoxPLTextdraw[playerid][0], 2);
  101.         TextDrawLetterSize(InfoBoxPLTextdraw[playerid][0], 0.300000, 1.299998);
  102.         TextDrawColor(InfoBoxPLTextdraw[playerid][0], -65281);
  103.         TextDrawSetOutline(InfoBoxPLTextdraw[playerid][0], 1);
  104.         TextDrawSetProportional(InfoBoxPLTextdraw[playerid][0], 1);
  105.            
  106.         InfoBoxPLTextdraw[playerid][1] = TextDrawCreate(487.000000, 369.000000, text);
  107.         TextDrawBackgroundColor(InfoBoxPLTextdraw[playerid][1], 255);
  108.         TextDrawFont(InfoBoxPLTextdraw[playerid][1], 1);
  109.         TextDrawLetterSize(InfoBoxPLTextdraw[playerid][1], 0.259999, 0.899999);
  110.         TextDrawColor(InfoBoxPLTextdraw[playerid][1], -1);
  111.         TextDrawSetOutline(InfoBoxPLTextdraw[playerid][1], 1);
  112.         TextDrawSetProportional(InfoBoxPLTextdraw[playerid][1], 1);            
  113.                        
  114.         TextDrawShowForPlayer(playerid,InfoBoxPLTextdraw[playerid][0]);
  115.         TextDrawShowForPlayer(playerid,InfoBoxPLTextdraw[playerid][1]);
  116.         InfoTextState[playerid]=true;
  117.         InfoBoxTimer[playerid]=SetTimerEx("InfoBoxHide",time,0,"u",playerid);
  118.     }
  119. }
  120.  
  121. public InfoBoxHide(playerid)
  122. {
  123.     TextDrawHideForPlayer(playerid,InfoBoxTextdraw[0]);
  124.     TextDrawHideForPlayer(playerid,InfoBoxTextdraw[1]);
  125.     TextDrawHideForPlayer(playerid,InfoBoxPLTextdraw[playerid][0]);
  126.     TextDrawHideForPlayer(playerid,InfoBoxPLTextdraw[playerid][1]);
  127.     TextDrawDestroy(InfoBoxPLTextdraw[playerid][0]);
  128.     TextDrawDestroy(InfoBoxPLTextdraw[playerid][1]);
  129.     InfoTextState[playerid]=false;
  130.     KillTimer(InfoBoxTimer[playerid]);
  131.     return 1;
  132. }
  133.  
  134. public InfoBoxHideAll()
  135. {
  136.     for(new i=0; i<MAX_PLAYERS; i++)
  137.     {
  138.         TextDrawHideForPlayer(i,InfoBoxTextdraw[0]);
  139.         TextDrawHideForPlayer(i,InfoBoxTextdraw[1]);
  140.         TextDrawHideForPlayer(i,InfoBoxPLTextdrawAll[i][0]);
  141.         TextDrawHideForPlayer(i,InfoBoxPLTextdrawAll[i][1]);
  142.         TextDrawDestroy(InfoBoxPLTextdrawAll[i][0]);
  143.         TextDrawDestroy(InfoBoxPLTextdrawAll[i][1]);
  144.         InfoTextStateAll[i]=false;
  145.         KillTimer(InfoBoxTimerAll[i]);
  146.     }
  147.     return 1;
  148. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement