I don't use that new function, here is speed td
Код:
new Text:TextdrawBrzina[MAX_PLAYERS]; // brzinometar
then this under onplayerconect
Код:
TextdrawBrzina[playerid] = TextDrawCreate(507.000000, 395.000000, " "); // brzinometar
TextDrawBackgroundColor(TextdrawBrzina[playerid], 255);
TextDrawFont(TextdrawBrzina[playerid], 1);
TextDrawLetterSize(TextdrawBrzina[playerid], 0.330000, 1.299999);
TextDrawColor(TextdrawBrzina[playerid], -1);
TextDrawSetOutline(TextdrawBrzina[playerid], 1);
TextDrawSetProportional(TextdrawBrzina[playerid], 1);
And i have timer "razno" on 360 ms, and under it i put string on td
Код:
public Razno()
{
foreach(Player, i)
{
new string[128];
new string2[128];
new string3[128];
if(!IsPlayerInAnyVehicle(i))
{
TextDrawHideForPlayer(i, TextdrawGorivo[i]);
TextDrawHideForPlayer(i, TextdrawGorivo2[i]);
TextDrawHideForPlayer(i, TextdrawBrzina[i]);
}
if(GetPlayerState(i) == 2 || GetPlayerState(i) == PLAYER_STATE_PASSENGER)
{
new Float:X, Float:Y, Float:Z, Float:km;
GetVehicleVelocity(GetPlayerVehicleID(i), X, Y, Z);
km = floatmul(floatsqroot(floatadd(floatadd(floatpower(X, 2), floatpower(Y, 2)), floatpower(Z, 2))), 138.0);
new Brzina3 = floatround(floatdiv(km, 0.75), floatround_floor);
format(string3,sizeof(string3),"~w~Brzina: %d~w~km/h",Brzina3);
TextDrawSetString(TextdrawBrzina[i], string3);
TextDrawShowForPlayer(i, TextdrawBrzina[i]);
That is only a part of that timer... i realy need to fix that bugs, or i will loose all players
I dellete them in onPlayerDisconect
Код:
TextDrawDestroy(TextdrawGorivo2[playerid]); TextDrawDestroy(TextdrawGorivo[playerid]); TextDrawDestroy(TextdrawBrzina[playerid]); TextDrawDestroy(TDPovez[playerid]);
TextDrawDestroy(Textdraw0[playerid]); TextDrawDestroy(Textdraw1[playerid]); TextDrawDestroy(Textdraw2[playerid]); TextDrawDestroy(Textdraw3[playerid]);
TextDrawDestroy(Textdraw7[playerid]); TextDrawDestroy(Textdraw6[playerid]); TextDrawDestroy(Textdraw5[playerid]); TextDrawDestroy(Textdraw4[playerid]);
TextDrawDestroy(Textdraw8[playerid]); TextDrawDestroy(Textdraw9[playerid]); TextDrawDestroy(Textdraw10[playerid]); TextDrawDestroy(Textdraw11[playerid]);
TextDrawDestroy(Textdraw15[playerid]); TextDrawDestroy(Textdraw14[playerid]); TextDrawDestroy(Textdraw13[playerid]); TextDrawDestroy(Textdraw12[playerid]);
TextDrawDestroy(Textdraw16[playerid]); TextDrawDestroy(Textdraw17[playerid]); TextDrawDestroy(Textdraw18[playerid]); TextDrawDestroy(Textdraw19[playerid]);
TextDrawDestroy(TDGlad[playerid]); TextDrawDestroy(Textdraw22[playerid]); TextDrawDestroy(Textdraw21[playerid]); TextDrawDestroy(Textdraw20[playerid]);
TextDrawDestroy(TDWc[playerid]); TextDrawDestroy(TDTutBox3[playerid]); TextDrawDestroy(TDTutBox2[playerid]); TextDrawDestroy(TDTutBox[playerid]);
TextDrawDestroy(TDTutBox4[playerid]); TextDrawDestroy(TDTutBox4[playerid]); TextDrawDestroy(TDTutBox5[playerid]); TextDrawDestroy(TDTutBox6[playerid]);
TextDrawDestroy(TDTutBoxText3[playerid]); TextDrawDestroy(TDTutBoxText2[playerid]); TextDrawDestroy(TDTutBoxText1[playerid]); TextDrawDestroy(TDTutBox7[playerid]);
TextDrawDestroy(TDTutBoxText4[playerid]); TextDrawDestroy(TDTutBoxText5[playerid]); TextDrawDestroy(TDTutBoxText6[playerid]); TextDrawDestroy(TDTutBoxText7[playerid]);
TextDrawDestroy(TDTutBoxText11[playerid]); TextDrawDestroy(TDTutBoxText10[playerid]); TextDrawDestroy(TDTutBoxText9[playerid]); TextDrawDestroy(TDTutBoxText8[playerid]);
TextDrawDestroy(TDTutBoxText12[playerid]); TextDrawDestroy(TDTutBoxText13[playerid]); TextDrawDestroy(TDTutBoxText14[playerid]); TextDrawDestroy(TDTutBoxText15[playerid]);
TextDrawDestroy(TDTutBoxText19[playerid]); TextDrawDestroy(TDTutBoxText18[playerid]); TextDrawDestroy(TDTutBoxText17[playerid]); TextDrawDestroy(TDTutBoxText16[playerid]);
TextDrawDestroy(TDTutBoxText20[playerid]); TextDrawDestroy(TDTutBoxText21[playerid]); TextDrawDestroy(TDTutBoxText22[playerid]); TextDrawDestroy(TDTutBoxText23[playerid]);
TextDrawDestroy(TDTutBoxText27[playerid]); TextDrawDestroy(TDTutBoxText26[playerid]); TextDrawDestroy(TDTutBoxText25[playerid]); TextDrawDestroy(TDTutBoxText24[playerid]);
TextDrawDestroy(TDTutBoxText28[playerid]); TextDrawDestroy(TDTutBoxText29[playerid]); TextDrawDestroy(TDTutBoxText30[playerid]); TextDrawDestroy(TDTutBoxText31[playerid]);
TextDrawDestroy(TDTutBoxText32[playerid]); TextDrawDestroy(TDTutBoxText33[playerid]); TextDrawDestroy(TDTutBoxText34[playerid]); TextDrawDestroy(TDTutBoxText35[playerid]);