Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- /////
- ///// /// /// /// //////////// ///////// //
- ///// /// /// /// /// /// /// // //
- ///// /// /// /// /// /// /// // //
- ///// /// /// /// /// /// /// // //
- ///// /// /// /// //////////// /// // // BY: DARTH_VADER
- ///// /// /// /// /// /// /// // //
- ///// //////////// //////////// /// /// /// // //
- ///// //////////// //////////// /// /// /// ////////
- /////
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- #define FILTERSCRIPT
- #include <a_samp>
- #include <zcmd>
- //FPS
- new TimerFPS[MAX_PLAYERS];
- new Text:FPS[MAX_PLAYERS];
- //PING
- new Text:PingT[MAX_PLAYERS];
- //TEXTDRAW INTRO
- new Text:LOGIN;
- new Text:LOGIN2;
- new Text:LOGIN3;
- //NICK
- new Text:SEUNICK;
- new Text:NICK;
- //PLAYERS ON
- new Text:TextDrawPlayers;
- new PlayersOnline = 0;
- //SCORE
- new Text:ScoreTextDraw[MAX_PLAYERS];
- //COMANDOS
- #define DIALOG_TEXTDRAW 1//MUDE PARA UMA ID QUE NÃO DE CONFLITOS EM SEU GAMEMODE
- //CORES
- #define VERMELHO 0xFF0000AA
- #define AZUL 0x0000FFAA
- public OnGameModeInit()
- {
- print("\n--------------------------------------");
- print("« Carregando Textdraw... »");
- print("\n--------------------------------------");
- //PING
- for( new i = 0; i < MAX_PLAYERS; i++ )
- {
- PingT[ i ] = TextDrawCreate(499.000000, 104.000000, " ");
- TextDrawBackgroundColor(PingT[ i ], 255);
- TextDrawAlignment(PingT[ i ], 1);
- TextDrawFont(PingT[ i ], 2);
- TextDrawLetterSize(PingT[ i ], 0.270000, 2.200000);
- TextDrawColor(PingT[ i ], -1);
- TextDrawSetOutline(PingT[ i ], 1);
- TextDrawSetProportional(PingT[ i ], 1);
- TextDrawSetShadow(PingT[ i ], 2);
- }
- //SCORE
- for(new i; i < MAX_PLAYERS; i++)
- {
- ScoreTextDraw[i] = TextDrawCreate(498.000000, 142.000000, " ");
- TextDrawBackgroundColor(ScoreTextDraw[i], 255);
- TextDrawFont(ScoreTextDraw[i], 2);
- TextDrawLetterSize(ScoreTextDraw[i], 0.270000, 2.200000);
- TextDrawColor(ScoreTextDraw[i], -1);
- TextDrawSetOutline(ScoreTextDraw[i], 1);
- TextDrawSetProportional(ScoreTextDraw[i], 1);
- TextDrawSetShadow(ScoreTextDraw[i], 1);
- }
- //TEXTDRAW INTRO
- LOGIN = TextDrawCreate(-30.000000, -5.000000, "TelaPreta");
- TextDrawBackgroundColor(LOGIN, 255);
- TextDrawFont(LOGIN, 1);
- TextDrawLetterSize(LOGIN, 0.700000, 53.099998);
- TextDrawColor(LOGIN, -1);
- TextDrawSetOutline(LOGIN, 0);
- TextDrawSetProportional(LOGIN, 1);
- TextDrawSetShadow(LOGIN, 1);
- TextDrawUseBox(LOGIN, 1);
- TextDrawBoxColor(LOGIN, 255);
- TextDrawTextSize(LOGIN, 650.000000, 30.000000);
- //
- LOGIN2 = TextDrawCreate(111.000000, 77.000000, "NOME DO SERVIDOR");
- TextDrawBackgroundColor(LOGIN2, 255);
- TextDrawAlignment(LOGIN2, 1);
- TextDrawFont(LOGIN2, 2);
- TextDrawLetterSize(LOGIN2, 0.949999, 9.299999);
- TextDrawUseBox(LOGIN2, 0);
- TextDrawColor(LOGIN2, 0xFFFFFFAA);
- TextDrawSetOutline(LOGIN2, 1);
- TextDrawSetProportional(LOGIN2, 1);
- //
- LOGIN3 = TextDrawCreate(477.000000, 148.000000, "VERSAO");
- TextDrawBackgroundColor(LOGIN3, 255);
- TextDrawAlignment(LOGIN3, 1);
- TextDrawFont(LOGIN3, 2);
- TextDrawLetterSize(LOGIN3, 0.579999, 2.499999);
- TextDrawUseBox(LOGIN3, 0);
- TextDrawColor(LOGIN3, 0xFFFFFFAA);
- TextDrawSetOutline(LOGIN3, 1);
- TextDrawSetProportional(LOGIN3, 1);
- //NICK
- SEUNICK = TextDrawCreate(225.000000, 207.000000, "SEU NICK E:");
- TextDrawBackgroundColor(SEUNICK, 255);
- TextDrawFont(SEUNICK, 2);
- TextDrawLetterSize(SEUNICK, 0.859999, 3.699998);
- TextDrawColor(SEUNICK, -1);
- TextDrawSetOutline(SEUNICK, 1);
- TextDrawSetProportional(SEUNICK, 1);
- //
- NICK = TextDrawCreate(98.000000, 264.000000, " ");
- TextDrawBackgroundColor(NICK, 255);
- TextDrawFont(NICK, 2);
- TextDrawLetterSize(NICK, 0.909999, 12.200010);
- TextDrawColor(NICK, -1);
- TextDrawSetOutline(NICK, 1);
- TextDrawSetProportional(NICK, 1);
- TextDrawSetShadow(NICK, 2);
- TextDrawAlignment(NICK, 1);
- //PLAYERS ON
- TextDrawPlayers = TextDrawCreate(498.000000, 123.000000, "");
- TextDrawBackgroundColor(TextDrawPlayers, 255);
- TextDrawFont(TextDrawPlayers, 2);
- TextDrawColor(TextDrawPlayers, -1);
- TextDrawSetOutline(TextDrawPlayers, 1);
- TextDrawSetProportional(TextDrawPlayers, 1);
- TextDrawSetShadow(TextDrawPlayers, 1);
- TextDrawAlignment(TextDrawPlayers, 1);
- TextDrawLetterSize(TextDrawPlayers, 0.329999, 2.299999);
- //-----------------------SETTIMERS------------------------------------//
- //SCORE
- SetTimer("AtualizarScore", 1000, 1);
- //PLAYERS ON
- SetTimer("PlayersOnlineText",1000, true);
- //PING
- SetTimer( "AtualizarPing", 1000, 1 );
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- SendClientMessage(playerid,AZUL,"Esse Servidor Possui Um Sistema De Textdraw Feito Por: Darth_Vader");
- //NICK
- new string[128];
- format(string, sizeof(string), "%s", rNome(playerid));
- TextDrawSetString(NICK, string);
- //FPS
- FPS[playerid] = TextDrawCreate(564.000000, 104.000000, " ");
- TextDrawBackgroundColor(FPS[playerid], 255);
- TextDrawFont(FPS[playerid], 2);
- TextDrawLetterSize(FPS[playerid], 0.270000, 2.200000);
- TextDrawColor(FPS[playerid], -1);
- TextDrawSetOutline(FPS[playerid], 1);
- TextDrawSetProportional(FPS[playerid], 1);
- TextDrawSetShadow(FPS[playerid], 2);
- //TEXTDRAW INTRO
- TextDrawShowForPlayer(playerid,LOGIN);
- TextDrawShowForPlayer(playerid,LOGIN2);
- TextDrawShowForPlayer(playerid,LOGIN3);
- //NICK
- TextDrawShowForPlayer(playerid,SEUNICK);
- TextDrawShowForPlayer(playerid,NICK);
- //FPS
- TimerFPS[playerid] = SetTimerEx("AtualizarFPS", 1000, true, "i", playerid);
- //PLAYERS ON
- PlayersOnline++;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- //FPS
- switch(reason)
- {
- case 0..2: KillTimer(TimerFPS[playerid]);
- }
- //PLAYERS ON
- PlayersOnline--;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- //TEXTDRAW INTRO
- TextDrawHideForPlayer(playerid, LOGIN);
- TextDrawHideForPlayer(playerid, LOGIN2);
- TextDrawHideForPlayer(playerid, LOGIN3);
- //NICK
- TextDrawHideForPlayer(playerid, SEUNICK);
- TextDrawHideForPlayer(playerid, NICK);
- //SCORE
- for(new i; i < MAX_PLAYERS; i++)
- {
- TextDrawHideForPlayer(playerid, ScoreTextDraw[i]);
- }
- //PLAYERS ON
- TextDrawHideForPlayer(playerid, TextDrawPlayers);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- //PING
- for( new i = 0; i < MAX_PLAYERS; i++ )
- {
- if( IsPlayerConnected( i ) )
- {
- TextDrawShowForPlayer( i, PingT[ i ] );
- }
- }
- //FPS
- TextDrawShowForPlayer(playerid, FPS[playerid]);
- //SCORE
- for(new i; i < MAX_PLAYERS; i++)
- {
- TextDrawShowForPlayer(playerid, ScoreTextDraw[i]);
- }
- //PLAYERS ON
- TextDrawShowForPlayer(playerid, TextDrawPlayers);
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- //FPS
- TextDrawHideForPlayer(playerid, FPS[playerid]);
- //PING
- TextDrawHideForPlayer(playerid, PingT[playerid]);
- //PLAYERS ON
- TextDrawHideForPlayer(playerid, TextDrawPlayers);
- //SCORE
- for(new i; i < MAX_PLAYERS; i++)
- {
- TextDrawHideForPlayer(playerid, ScoreTextDraw[i]);
- }
- return 1;
- }
- //PING
- forward AtualizarPing();
- public AtualizarPing()
- {
- new string[ 16 ];
- for( new i = 0; i < MAX_PLAYERS; i++ )
- {
- if( IsPlayerConnected( i ) )
- {
- format( string, sizeof( string ), "~r~PING: ~w~%d", GetPlayerPing(i) );
- TextDrawSetString( PingT[ i ], string);
- }
- }
- return 1;
- }
- //FPS
- forward AtualizarFPS(playerid);
- public AtualizarFPS(playerid)
- {
- new string[128];
- format(string, sizeof(string), "~y~FPS: ~w~%d", GetPlayerFPS(playerid));
- TextDrawSetString(FPS[playerid], string);
- return 1;
- }
- //SCORE
- forward AtualizarScore(playerid);
- public AtualizarScore(playerid)
- {
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- new STR[26];
- format(STR, 26, "~b~SCORES: ~w~%i", GetPlayerScore(i));
- TextDrawSetString(ScoreTextDraw[i], STR);
- }
- }
- return 1;
- }
- //PLAYERS
- forward PlayersOnlineText();
- public PlayersOnlineText()
- {
- new String[100];
- format(String, sizeof(String), "~w~~h~PLAYERS: ~w~%d~w~~w~/~w~%d", PlayersOnline, GetMaxPlayers());
- TextDrawSetString(TextDrawPlayers, String);
- return 1;
- }
- //COMANDO
- CMD:hud(playerid, params[])
- {
- ShowPlayerDialog(playerid, DIALOG_TEXTDRAW, DIALOG_STYLE_MSGBOX, "{FF0000}#{FFFFFF}HUD", "{0000FF}O Que Você Fazer Com As Tetxdraw", "Exibir", "Esconder");
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_TEXTDRAW)
- {
- if(response)
- {
- //PING
- for( new i = 0; i < MAX_PLAYERS; i++ )
- {
- if( IsPlayerConnected( i ) )
- {
- TextDrawShowForPlayer( i, PingT[ i ] );
- }
- }
- //FPS
- TextDrawShowForPlayer(playerid, FPS[playerid]);
- //SCORE
- for(new i; i < MAX_PLAYERS; i++)
- {
- TextDrawShowForPlayer(playerid, ScoreTextDraw[i]);
- }
- //PLAYERS ON
- TextDrawShowForPlayer(playerid, TextDrawPlayers);
- SendClientMessage(playerid,VERMELHO,"Você Está Exibindo O HUD");
- }
- else
- {
- //FPS
- TextDrawHideForPlayer(playerid, FPS[playerid]);
- //PING
- TextDrawHideForPlayer(playerid, PingT[playerid]);
- //PLAYERS ON
- TextDrawHideForPlayer(playerid, TextDrawPlayers);
- //SCORE
- for(new i; i < MAX_PLAYERS; i++)
- {
- TextDrawHideForPlayer(playerid, ScoreTextDraw[i]);
- }
- SendClientMessage(playerid,VERMELHO,"Você Está Escondendo O HUD");
- }
- return true;
- }
- return 0;
- }
- //FPS
- stock GetPlayerFPS(playerid)
- {
- SetPVarInt(playerid, "DrunkL", GetPlayerDrunkLevel(playerid));
- if(GetPVarInt(playerid, "DrunkL") < 100)
- {
- SetPlayerDrunkLevel(playerid, 2000);
- }
- else
- {
- if(GetPVarInt(playerid, "LDrunkL") != GetPVarInt(playerid, "DrunkL"))
- {
- SetPVarInt(playerid, "FPS", (GetPVarInt(playerid, "LDrunkL") - GetPVarInt(playerid, "DrunkL")));
- SetPVarInt(playerid, "LDrunkL", GetPVarInt(playerid, "DrunkL"));
- if((GetPVarInt(playerid, "FPS") > 0) && (GetPVarInt(playerid, "FPS") < 256))
- {
- return GetPVarInt(playerid, "FPS") - 1;
- }
- }
- }
- return 0;
- }
- //NICK
- stock rNome(playerid)
- {
- new rnome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, rnome, MAX_PLAYER_NAME);
- return rnome;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement