Scripting help..1 line
#1

Well i trying to De-bug a script and re-moldel it well this is the line that wont compile
"GetVehicleVelocity" i know it's probaly not a command but i need something like it so i can
get the vehicle speed ...All help will be greatly appreciated Thx in advance
(I also just started scripting so please don't act like im stupid)
Reply
#2

GetVehicleVelocity is indeed a samp function. It will give you the velocity that the vehicle is moving on all the axis - x, y and z. You can read about it on the wiki here: https://sampwiki.blast.hk/wiki/GetVehicleVelocity

If you still have some problems, post the line/code in question and perhaps somebody will be able to help you out.
Reply
#3

Thank you very much
Reply
#4

I'll give you a small function, maybe you will use it:

pawn Код:
stock
    GetVehicleSpeed(vehicleid)
    {
        new
            Float: x,
            Float: y,
            Float: z;

        GetVehicleVelocity(vehicleid, x, y, z);
        return floatround((floatmul(floatsqroot(floatpower(x, 2.0) + floatpower(y, 2.0) + floatpower(z, 2.0)), 100.0) / 0.4463), floatround_floor);
    }
It returns the vehicle speed in kmp/h.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)