Velocidade na TextDraw -
LockeD - 09.05.2014
Galera a textdraw estб atualizando muito rбpido e fora do normal do que era pra estar..
Vнdeo:
Clique aqui para acessar o vнdeo
Cуdigo:
Nome do servidor:
PHP код:
new AtualizarNomeDoSv[][] = {
"~y~] ~y~~h~BRASIL MATA-MATA 2014! GUERRA EM SAN FIERRO! ~y~]",
"~y~] ~r~~h~BRASIL MATA-MATA 2014! GUERRA EM SAN FIERRO! ~y~]",
"~y~] ~r~~h~~h~BRASIL MATA-MATA 2014! GUERRA EM SAN FIERRO! ~y~]",
"~y~] ~p~~h~BRASIL MATA-MATA 2014! GUERRA EM SAN FIERRO! ~y~]",
"~y~] ~p~BRASIL MATA-MATA 2014! GUERRA EM SAN FIERRO! ~y~]",
"~y~] ~g~BRASIL MATA-MATA 2014! GUERRA EM SAN FIERRO! ~y~]",
"~y~] ~g~~h~BRASIL MATA-MATA 2014! GUERRA EM SAN FIERRO! ~y~]",
"~y~] ~r~BRASIL MATA-MATA 2014! GUERRA EM SAN FIERRO! ~y~]",
"~y~] ~y~BRASIL MATA-MATA 2014! GUERRA EM SAN FIERRO! ~y~]",
"~y~] ~w~BRASIL MATA-MATA 2014! GUERRA EM SAN FIERRO! ~y~]"
};
OnPlayerConnect:
TimerA[playerid] = SetTimerEx( "AtualizarNome" , 10000 , true , "i" , playerid );
//
forward AtualizarNome(playerid);
public AtualizarNome(playerid)
{
if ( !IsPlayerConnected ( playerid ) ) return 0;
new
str[ 128 ]
;
format(str, 128, " %s", AtualizarNomeDoSv[random(sizeof(AtualizarNomeDoSv))]);
PlayerTextDrawSetString(playerid, ConfigServer0, str);
return 1;
}
Onde mostra os score, packet, ping, fps ( status ):
PHP код:
OnPlayerConnect:
TDScore[playerid] = SetTimerEx ( "AtualizarScore" , 1000 , true , "i" , playerid );
//
forward AtualizarScore ( playerid ); public AtualizarScore ( playerid ) {
if ( !IsPlayerConnected ( playerid ) ) return 0;
new
STR [ 280 ]
;
format ( STR , 280, "~r~|~n~ ~r~Score: ~w~%d~n~ ~r~Mortes: ~w~%d~n~ ~r~EXP: ~w~%d~n~ ~r~Shots: ~w~%d~n~ ~r~Spree: ~w~%d~n~ ~r~Ping: ~w~%d~n~ ~r~FPS: ~w~%d~n~ ~r~Packet: ~w~%.2f~n~|~n~|", GetPlayerScore ( playerid ) , PlayerDados [ playerid ] [ Morreu ] , PlayerDados [ playerid ] [ Experiencia ] , PlayerDados [ playerid ][ Shots ] , Spree [ playerid ] , GetPlayerPing ( playerid ) , pFPS [ playerid ], NetStats_PacketLossPercent ( playerid ) );
PlayerTextDrawSetString ( playerid , ScoreTextDraw0 [ playerid ] , STR );
return true;
}
NOTA: Isso ocorre quando o servidor fica ligado direto umas 3 ou 4 hrs, as vezes mais e as vezes menos..
Re: Velocidade na TextDraw -
iTzDemon - 09.05.2014
Estбs a criar muitos timers so 1 coisa simples. Tenta optimizar isso
Crivas um TextDraw normal e fazias a actualizaзгo apenas 1 vez em vez de 100 ou ate msm 500
Re: Velocidade na TextDraw -
Bruno Alves - 09.05.2014
pawn Код:
SetTimerEx( "AtualizarNome" , 10000 , true , "i" , playerid );
ta vendo aql 10 mil ali ?
ex: 1000 = 1 segund0
2000 = 2 segundos
e assim por dianteali ja q й 10000 й 10 segundos para atualizar.... se quiser pd aumentar ou diminuir
Re: Velocidade na TextDraw -
maykoncoelho - 15.02.2015
Boa noite, teria como disponibilizar esse cуdigo dessa texdraw por completo?
Re: Velocidade na TextDraw -
Learning - 15.02.2015
manda nome da musica
Re: Velocidade na TextDraw -
maykoncoelho - 15.02.2015
Alguem tem esse código dessa textdraw?