SA-MP Forums Archive
[Help] - Mileage - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Help] - Mileage (/showthread.php?tid=509439)



[Help] - Mileage - SpaMaster - 26.04.2014

How to make this ? Is there any tutorial, or something ?


Re: [Help] - Mileage - GeasyW - 26.04.2014

pawn Код:
new Float:Milleage[MAX_VEHICLES];
pawn Код:
new Float:ST[4], vehicleid;

vehicleid = GetPlayerVehicleID(playerid);
   
    GetVehicleVelocity(vehicleid,ST[0],ST[1],ST[2]);
    ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 179.28625;

    Milleage[vehicleid] += ST[3]/2000;
In Kilometers
Hopefully I helped you.


Re: [Help] - Mileage - SpaMaster - 26.04.2014

Quote:
Originally Posted by GeasyW
Посмотреть сообщение
pawn Код:
new Float:Milleage[MAX_VEHICLES];
pawn Код:
new Float:ST[4], vehicleid;

vehicleid = GetPlayerVehicleID(playerid);
   
    GetVehicleVelocity(vehicleid,ST[0],ST[1],ST[2]);
    ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 179.28625;

    Milleage[vehicleid] += ST[3]/2000;
In Kilometers
Hopefully I helped you.
That's it
Thank you very much...


Re: [Help] - Mileage - GeasyW - 26.04.2014

Glad to help you