Getting the string to update
#1

I have tried to make a simple speedo meter but it only shows the speed once.

Textdraw:
pawn Код:
new string[124], vehicleid = GetPlayerVehicleID(playerid);
    format(string, sizeof(string), "_Speed: %d", GetVehicleSpeed(vehicleid));
    Test1 = TextDrawCreate(6.500000, 429.187500, "Loading....");
    TextDrawSetString(Test1, string);
    TextDrawLetterSize(Test1, 0.281497, 1.411874);
    TextDrawTextSize(Test1, 132.500000, 24.937500);
    TextDrawAlignment(Test1, 1);
    TextDrawColor(Test1, -1);
    TextDrawUseBox(Test1, true);
    TextDrawBoxColor(Test1, 0x1F1F1F88);
    TextDrawSetShadow(Test1, 0);
    TextDrawSetOutline(Test1, 1);
    TextDrawBackgroundColor(Test1, 51);
    TextDrawFont(Test1, 1);
    TextDrawSetProportional(Test1, 1);
   
    TextDrawShowForPlayer(playerid, Test1);
GetVehicleSpeed:
pawn Код:
stock GetVehicleSpeed(vehicleid)
{
    new Float:x, Float:y, Float:z, vel;
    GetVehicleVelocity( vehicleid, x, y, z );
    vel = floatround( floatsqroot( x*x + y*y + z*z ) * 180 );
    return vel;
}
Reply


Messages In This Thread
Getting the string to update - by AccountName - 29.05.2013, 08:10
Re: Getting the string to update - by Pottus - 29.05.2013, 08:14
Re: Getting the string to update - by Vince - 29.05.2013, 08:14
Re: Getting the string to update - by AccountName - 29.05.2013, 08:15
Re: Getting the string to update - by AccountName - 29.05.2013, 08:21

Forum Jump:


Users browsing this thread: 2 Guest(s)