07.02.2014, 23:56
pawn Код:
#define MULTIPLY_SPEED 3
new Float:OldCoordsX[MAX_PLAYERS], Float:OldCoordsY[MAX_PLAYERS];
new Float:x, Float:y, Float:z, Float:health, string[256];
new Float:Dis = floatsqroot(floatpower(floatabs(floatsub(OldCoordsX[i],x)),2) + floatpower(floatabs(floatsub(OldCoordsY[i],y)),2));
new speed = (floatround(Dis)*MULTIPLY_SPEED);
i made a textdraw shows the vehicle's speed using this method, the textdraw is an integer string (%i)and the definition of the integer is "speed" ..example:
pawn Код:
format(string,sizeof(string),"Speed: %i" ,speed);