Advertisement
Guest User

CreateBox

a guest
May 12th, 2012
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. new Text:ueberschrift[MAX_PLAYERS];
  4. new Text:insidetext[MAX_PLAYERS];
  5.  
  6. static bool:fnc[1] = false;
  7.  
  8. public OnGameModeInit()
  9. {
  10. fnc[0] = (funcidx("CB_OnPlayerConnect") != -1);
  11. CallLocalFunction("CB_OnGameModeInit", "");
  12. }
  13.  
  14. #if defined _ALS_OnGameModeInit
  15. #undef OnGameModeInit
  16. #else
  17. #define _ALS_OnGameModeInit
  18. #endif
  19. #define OnGameModeInit CB_OnGameModeInit
  20. forward CB_OnGameModeInit();
  21.  
  22. public OnPlayerConnect(playerid)
  23. {
  24. if(fnc[0]) CallLocalFunction("Box_OnPlayerConnect", "i", playerid);
  25. ueberschrift[playerid] = TextDrawCreate(501.000000, 222.000000, "info");
  26. TextDrawBackgroundColor(ueberschrift[playerid], 50);
  27. TextDrawFont(ueberschrift[playerid], 2);
  28. TextDrawLetterSize(ueberschrift[playerid], 0.320000, 1.299999);
  29. TextDrawColor(ueberschrift[playerid], -1);
  30. TextDrawSetOutline(ueberschrift[playerid], 1);
  31. TextDrawSetProportional(ueberschrift[playerid], 1);
  32. TextDrawUseBox(ueberschrift[playerid], 1);
  33. TextDrawBoxColor(ueberschrift[playerid], 6062591);
  34. TextDrawTextSize(ueberschrift[playerid], 586.000000, 0.000000);
  35. insidetext[playerid] = TextDrawCreate(501.000000, 237.000000, "neki insidetext ide ovde za test~n~neki insidetext ide ovde~n~i tako dalje aaaaa");
  36. TextDrawBackgroundColor(insidetext[playerid], 50);
  37. TextDrawFont(insidetext[playerid], 0);
  38. TextDrawLetterSize(insidetext[playerid], 0.270000, 1.000000);
  39. TextDrawColor(insidetext[playerid], -1);
  40. TextDrawSetOutline(insidetext[playerid], 1);
  41. TextDrawSetProportional(insidetext[playerid], 1);
  42. TextDrawUseBox(insidetext[playerid], 1);
  43. TextDrawBoxColor(insidetext[playerid], 150);
  44. TextDrawTextSize(insidetext[playerid], 586.000000, 0.000000);
  45. return 1;
  46. }
  47.  
  48. #if defined _ALS_OnPlayerConnect
  49. #undef OnPlayerConnect
  50. #else
  51. #define _ALS_OnPlayerConnect
  52. #endif
  53. #define OnPlayerConnect CB_OnPlayerConnect
  54. forward CB_OnPlayerConnect(playerid);
  55.  
  56. stock CreateBox(playerid,header[],text[])
  57. {
  58. new string[128];
  59.  
  60. format(string, sizeof string,"%s",header);
  61. TextDrawSetString(Text:ueberschrift[playerid],string);
  62. TextDrawShowForPlayer(playerid,Text:ueberschrift[playerid]);
  63.  
  64. format(string, sizeof string,"%s",text);
  65. TextDrawSetString(Text:insidetext[playerid],string);
  66. TextDrawShowForPlayer(playerid,Text:insidetext[playerid]);
  67.  
  68. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  69.  
  70. SetPVarInt(playerid,"CreateBoxEx",1);
  71. SetTimerEx("CloseBox", 5000, 0, "i", playerid);
  72. return 1;
  73. }
  74.  
  75. forward CloseBox(playerid);
  76. public CloseBox(playerid)
  77. {
  78. TextDrawHideForPlayer(playerid,Text:ueberschrift[playerid]);
  79. TextDrawHideForPlayer(playerid,Text:insidetext[playerid]);
  80. return 1;
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement