Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*>>>>>>>>>>>>>>>>>By Wolfman1 Eng - Esp thanks<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
- #include <a_samp>
- // ========================================================================== //
- // =============== [ Entrar al server y al salir del server ] =============== //
- #pragma tabsize 0
- // ========================================================================== //
- // =============== [ Entrar al server y al salir del server ] =============== //
- #define Mensajes 4
- // ========================================================================== //
- // =============== [ Entrar al server y al salir del server ] =============== //
- new Text:Desconectar[Mensajes],Text:Conectar[Mensajes];
- new CurrentIndex;
- // ========================================================================== //
- // =============== [ Entrar al server y al salir del server ] =============== //
- public OnGameModeExit()
- {
- TextDrawDestroy(Conectar[CurrentIndex]);
- TextDrawDestroy(Desconectar[CurrentIndex]);
- return 1;
- }
- public OnGameModeInit()
- {
- for(new i=0; i < Mensajes; i++)
- {
- Desconectar[i] = TextDrawCreate(250.000000, 426.000000 + (i * 10), "_");
- TextDrawBackgroundColor(Desconectar[i], 255);
- TextDrawFont(Desconectar[i], 2);
- TextDrawLetterSize(Desconectar[i], 0.210000, 1.000000);
- TextDrawColor(Desconectar[i], -1);
- TextDrawSetOutline(Desconectar[i], 0);
- TextDrawSetProportional(Desconectar[i], 1);
- TextDrawSetShadow(Desconectar[i], 1);
- Conectar[i] = TextDrawCreate(250.000000, 426.000000 + (i * 10), "_");
- TextDrawBackgroundColor(Conectar[i], 255);
- TextDrawFont(Conectar[i], 2);
- TextDrawLetterSize(Conectar[i], 0.210000, 1.000000);
- TextDrawColor(Conectar[i], -1);
- TextDrawSetOutline(Conectar[i], 0);
- TextDrawSetProportional(Conectar[i], 1);
- TextDrawSetShadow(Conectar[i], 1);
- }
- return 1;
- }
- // ========================================================================== //
- // =============== [ Entrar al server y al salir del server ] =============== //
- public OnPlayerConnect(playerid)
- {
- new String[256];
- new Nombre[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Nombre, MAX_PLAYER_NAME);
- format(String, sizeof(String), "~r~%s ~w~has join the ~g~server", Nombre);
- TextDrawSetString(Conectar[CurrentIndex], String);
- Textdraw(playerid);
- for(new i=0; i < Mensajes; i--)
- {
- TextDrawShowForPlayer(playerid, Conectar[i]);
- TextDrawShowForPlayer(playerid, Desconectar[i]);
- }
- return (CurrentIndex + 10 != Mensajes) ? (CurrentIndex --) : (CurrentIndex = 0);
- }
- // ========================================================================== //
- // =============== [ Entrar al server y al salir del server ] =============== //
- public OnPlayerDisconnect(playerid, reason)
- {
- new String[256];
- new Nombre[MAX_PLAYER_NAME];
- GetPlayerName(playerid,Nombre,sizeof(Nombre));
- format(String,sizeof(String),"~r~%s ~w~has been ~g~disconnected",Nombre);
- TextDrawSetString(Desconectar[CurrentIndex], String);
- return (CurrentIndex + 10 != Mensajes) ? (CurrentIndex --) : (CurrentIndex = 0);
- }
- // ========================================================================== //
- // =============== [ Entrar al server y al salir del server ] =============== //
- stock Textdraw(playerid)
- {
- TextDrawShowForAll(Conectar[CurrentIndex]);
- TextDrawShowForAll(Desconectar[CurrentIndex]);
- SetTimerEx("BorrarTextDraw",5000,0,"d",playerid);
- return 1;
- }
- // ========================================================================== //
- // =============== [ Entrar al server y al salir del server ] =============== //
- forward BorrarTextDraw(playerid);
- public BorrarTextDraw(playerid)
- {
- TextDrawHideForAll(Conectar[CurrentIndex]);
- TextDrawHideForAll(Desconectar[CurrentIndex]);
- return 1;
- }
- // ========================================================================== //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement