Advertisement
Guest User

A_Infobox - by Azure

a guest
Jun 26th, 2013
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.32 KB | None | 0 0
  1. /*
  2.     Include: A_Infobox
  3.     Include by: Azure
  4.     Version: -
  5.     Release: 26.06.2013
  6.     native InfoText(playerid,overview[50],text[200]);
  7. */
  8. new Text:InfoBoxTextdraw[2];
  9. new Text:InfoBoxPLTextdraw[MAX_PLAYERS][2];
  10. new bool:InfoTextState[MAX_PLAYERS];
  11.  
  12. forward InfoBoxHide(playerid);
  13.  
  14. public OnGameModeInit()
  15. {
  16.     InfoBoxTextdraw[0] = TextDrawCreate(652.000000, 250.000000, "-");
  17.     TextDrawBackgroundColor(InfoBoxTextdraw[0], 255);
  18.     TextDrawFont(InfoBoxTextdraw[0], 1);
  19.     TextDrawLetterSize(InfoBoxTextdraw[0], 0.000000, 10.100000);
  20.     TextDrawColor(InfoBoxTextdraw[0], -1);
  21.     TextDrawSetOutline(InfoBoxTextdraw[0], 0);
  22.     TextDrawSetProportional(InfoBoxTextdraw[0], 1);
  23.     TextDrawSetShadow(InfoBoxTextdraw[0], 1);
  24.     TextDrawUseBox(InfoBoxTextdraw[0], 1);
  25.     TextDrawBoxColor(InfoBoxTextdraw[0], 80);
  26.     TextDrawTextSize(InfoBoxTextdraw[0], 496.000000, 0.000000);
  27.  
  28.     InfoBoxTextdraw[1] = TextDrawCreate(533.000000, 236.000000, "Information");
  29.     TextDrawBackgroundColor(InfoBoxTextdraw[1], 255);
  30.     TextDrawFont(InfoBoxTextdraw[1], 0);
  31.     TextDrawLetterSize(InfoBoxTextdraw[1], 0.600000, 2.099999);
  32.     TextDrawColor(InfoBoxTextdraw[1], 0x0069FFFF);
  33.     TextDrawSetOutline(InfoBoxTextdraw[1], 0);
  34.     TextDrawSetProportional(InfoBoxTextdraw[1], 1);
  35.     TextDrawSetShadow(InfoBoxTextdraw[1], 1);
  36.     return CallLocalFunction("__OnGameModeInit","");
  37. }
  38. #if defined _ALS_OnGameModeInit
  39.     #undef OnGameModeInit
  40. #else
  41.     #define _ALS_OnGameModeInit
  42. #endif
  43. #define OnGameModeInit __OnGameModeInit
  44. forward __OnGameModeInit();
  45.  
  46. stock InfoText(playerid,overview[50],text[200])
  47. {
  48.     if(!InfoTextState[playerid])
  49.     {
  50.         for(new i;i<sizeof(InfoBoxTextdraw);i++)
  51.         {
  52.             TextDrawShowForPlayer(playerid,InfoBoxTextdraw[i]);
  53.         }
  54.         InfoBoxPLTextdraw[playerid][0] = TextDrawCreate(508.000000, 260.000000, overview);
  55.         TextDrawBackgroundColor(InfoBoxPLTextdraw[playerid][0], 255);
  56.         TextDrawFont(InfoBoxPLTextdraw[playerid][0], 1);
  57.         TextDrawLetterSize(InfoBoxPLTextdraw[playerid][0], 0.500000, 1.500000);
  58.         TextDrawColor(InfoBoxPLTextdraw[playerid][0], 513867775);
  59.         TextDrawSetOutline(InfoBoxPLTextdraw[playerid][0], 0);
  60.         TextDrawSetProportional(InfoBoxPLTextdraw[playerid][0], 1);
  61.         TextDrawSetShadow(InfoBoxPLTextdraw[playerid][0], 1);
  62.  
  63.         InfoBoxPLTextdraw[playerid][1] = TextDrawCreate(503.000000, 280.000000, text);
  64.         TextDrawBackgroundColor(InfoBoxPLTextdraw[playerid][1], 255);
  65.         TextDrawFont(InfoBoxPLTextdraw[playerid][1], 2);
  66.         TextDrawLetterSize(InfoBoxPLTextdraw[playerid][1], 0.230000, 1.000000);
  67.         TextDrawColor(InfoBoxPLTextdraw[playerid][1], -1);
  68.         TextDrawSetOutline(InfoBoxPLTextdraw[playerid][1], 0);
  69.         TextDrawSetProportional(InfoBoxPLTextdraw[playerid][1], 1);
  70.         TextDrawSetShadow(InfoBoxPLTextdraw[playerid][1], 1);
  71.         TextDrawShowForPlayer(playerid,InfoBoxPLTextdraw[playerid][0]);
  72.         TextDrawShowForPlayer(playerid,InfoBoxPLTextdraw[playerid][1]);
  73.         InfoTextState[playerid]=true;
  74.         SetTimerEx("InfoBoxHide",5000,0,"u",playerid);
  75.     }
  76. }
  77.  
  78. public InfoBoxHide(playerid)
  79. {
  80.     for(new i;i<sizeof(InfoBoxTextdraw);i++)
  81.     {
  82.         TextDrawHideForPlayer(playerid,InfoBoxTextdraw[i]);
  83.     }
  84.     TextDrawHideForPlayer(playerid,InfoBoxPLTextdraw[playerid][0]);
  85.     TextDrawHideForPlayer(playerid,InfoBoxPLTextdraw[playerid][1]);
  86.     TextDrawDestroy(InfoBoxPLTextdraw[playerid][0]);
  87.     TextDrawDestroy(InfoBoxPLTextdraw[playerid][1]);
  88.     InfoTextState[playerid]=false;
  89.     return 1;
  90. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement