Advertisement
Guest User

Textdraw

a guest
Jan 22nd, 2013
474
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.71 KB | None | 0 0
  1. /*>>>>>>>>>>>>>>>>>By Wolfman1 Eng - Esp thanks<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
  2. #include <a_samp>
  3. // ========================================================================== //
  4.  
  5. // =============== [ Entrar al server y al salir del server ] =============== //
  6. #pragma tabsize 0
  7. // ========================================================================== //
  8.  
  9. // =============== [ Entrar al server y al salir del server ] =============== //
  10. #define Mensajes 4
  11. // ========================================================================== //
  12.  
  13. // =============== [ Entrar al server y al salir del server ] =============== //
  14. new Text:Desconectar[Mensajes],Text:Conectar[Mensajes];
  15. new CurrentIndex;
  16. // ========================================================================== //
  17.  
  18. // =============== [ Entrar al server y al salir del server ] =============== //
  19. public OnGameModeExit()
  20. {
  21. TextDrawDestroy(Conectar[CurrentIndex]);
  22. TextDrawDestroy(Desconectar[CurrentIndex]);
  23. return 1;
  24. }
  25.  
  26. public OnGameModeInit()
  27. {
  28. for(new i=0; i < Mensajes; i++)
  29. {
  30. Desconectar[i] = TextDrawCreate(250.000000, 426.000000 + (i * 10), "_");
  31. TextDrawBackgroundColor(Desconectar[i], 255);
  32. TextDrawFont(Desconectar[i], 2);
  33. TextDrawLetterSize(Desconectar[i], 0.210000, 1.000000);
  34. TextDrawColor(Desconectar[i], -1);
  35. TextDrawSetOutline(Desconectar[i], 0);
  36. TextDrawSetProportional(Desconectar[i], 1);
  37. TextDrawSetShadow(Desconectar[i], 1);
  38.  
  39. Conectar[i] = TextDrawCreate(250.000000, 426.000000 + (i * 10), "_");
  40. TextDrawBackgroundColor(Conectar[i], 255);
  41. TextDrawFont(Conectar[i], 2);
  42. TextDrawLetterSize(Conectar[i], 0.210000, 1.000000);
  43. TextDrawColor(Conectar[i], -1);
  44. TextDrawSetOutline(Conectar[i], 0);
  45. TextDrawSetProportional(Conectar[i], 1);
  46. TextDrawSetShadow(Conectar[i], 1);
  47. }
  48. return 1;
  49. }
  50. // ========================================================================== //
  51.  
  52. // =============== [ Entrar al server y al salir del server ] =============== //
  53. public OnPlayerConnect(playerid)
  54. {
  55. new String[256];
  56. new Nombre[MAX_PLAYER_NAME];
  57. GetPlayerName(playerid, Nombre, MAX_PLAYER_NAME);
  58. format(String, sizeof(String), "~r~%s ~w~has join the ~g~server", Nombre);
  59. TextDrawSetString(Conectar[CurrentIndex], String);
  60. Textdraw(playerid);
  61. for(new i=0; i < Mensajes; i--)
  62. {
  63. TextDrawShowForPlayer(playerid, Conectar[i]);
  64. TextDrawShowForPlayer(playerid, Desconectar[i]);
  65. }
  66. return (CurrentIndex + 10 != Mensajes) ? (CurrentIndex --) : (CurrentIndex = 0);
  67. }
  68. // ========================================================================== //
  69.  
  70. // =============== [ Entrar al server y al salir del server ] =============== //
  71. public OnPlayerDisconnect(playerid, reason)
  72. {
  73. new String[256];
  74. new Nombre[MAX_PLAYER_NAME];
  75. GetPlayerName(playerid,Nombre,sizeof(Nombre));
  76. format(String,sizeof(String),"~r~%s ~w~has been ~g~disconnected",Nombre);
  77. TextDrawSetString(Desconectar[CurrentIndex], String);
  78. return (CurrentIndex + 10 != Mensajes) ? (CurrentIndex --) : (CurrentIndex = 0);
  79. }
  80. // ========================================================================== //
  81.  
  82. // =============== [ Entrar al server y al salir del server ] =============== //
  83. stock Textdraw(playerid)
  84. {
  85. TextDrawShowForAll(Conectar[CurrentIndex]);
  86. TextDrawShowForAll(Desconectar[CurrentIndex]);
  87. SetTimerEx("BorrarTextDraw",5000,0,"d",playerid);
  88. return 1;
  89. }
  90. // ========================================================================== //
  91.  
  92. // =============== [ Entrar al server y al salir del server ] =============== //
  93. forward BorrarTextDraw(playerid);
  94. public BorrarTextDraw(playerid)
  95. {
  96. TextDrawHideForAll(Conectar[CurrentIndex]);
  97. TextDrawHideForAll(Desconectar[CurrentIndex]);
  98. return 1;
  99. }
  100. // ========================================================================== //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement