Speed problem
#1

When i do enter the vehicle , it shows 25 directly before i drive

Код:
//stock]
stock GetPlayerSpeed(playerid,bool:kmh) // by misco
{
    new Float:Vx,Float:Vy,Float:Vz,Float:rtn;
    if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid),Vx,Vy,Vz); else GetPlayerVelocity(playerid,Vx,Vy,Vz);
    rtn = floatsqroot(floatabs(floatpower(Vx + Vy + Vz,2)));
    return kmh?floatround(rtn * 100 * 1.61):floatround(rtn * 100);
}

//Onplayerentervehicle
	new kmh = GetPlayerSpeed(playerid, true);
    new string[124];
 	if(kmh >= 0 && kmh <= 80)
	{
		format(string, 64, "~w~Speed: ~g~~h~%d ~w~KM/h.", kmh);
	}
	else if(kmh >= 81 && kmh <= 120)
	{
		format(string, 64, "~w~Speed: ~y~~h~%d ~w~KM/h.", kmh);
	}
		else if(kmh >= 121)
	{
	format(string, 64, "~w~Speed: ~r~~h~%d ~w~KM/h.", kmh);
	}
Anyone here to help?
Reply
#2

Quote:
Originally Posted by fuckingcruse
Посмотреть сообщение
it shows 25 directly before i drive
Does the amount change after showing 25?
If it does, after how much time?
Reply
#3

It does like 10-15secs it changes always
Reply
#4

Quote:
Originally Posted by fuckingcruse
Посмотреть сообщение
It does like 10-15secs it changes always
I think you should change the textdraw string because everytime the textdraw will be shown, it'll always show its default string.

I think you have something like:
pawn Код:
textdraw = TextDrawCreate(x, y, "text");
If you show the textdraw without changing the string (TextDrawSetString), it'll always show the default string which is "text" in this case.
Reply
#5

Код:
	Textdraw39[playerid] = TextDrawCreate(498.000000, 123.000000, ""); // speedo
	TextDrawBackgroundColor(Textdraw39[playerid], 255);
	TextDrawFont(Textdraw39[playerid], 1);
	TextDrawLetterSize(Textdraw39[playerid], 0.389899, 1.299900);
	TextDrawColor(Textdraw39[playerid], 13107455);
	TextDrawSetOutline(Textdraw39[playerid], 1);
	TextDrawSetProportional(Textdraw39[playerid], 1);
	TextDrawShowForPlayer(playerid, Textdraw39[playerid]);
Text draw codes
Reply
#6

Actually needs help. I tried my best nothing comes out. Help me please guys?
Reply
#7

BUMB 24hrs up after some time!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)