Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // -----------------------------------------------------------
- #include a_samp
- // -----------------------------------------------------------
- new
- gMetrosRodados[MAX_VEHICLES] = {0, ...}
- ;
- // -----------------------------------------------------------
- #define MetrosRodados(%0) \
- gMetrosRodados[%0]
- #define KilometrosRodados(%0) \
- (gMetrosRodados[%0] / 1000)
- // -----------------------------------------------------------
- public OnFilterScriptInit() {
- SetTimer("metrosRodados", 1000, true);
- return true;
- }
- // -----------------------------------------------------------
- forward metrosRodados();
- public metrosRodados() {
- static
- Float:x,
- Float:y,
- Float:z;
- for(new i; i != MAX_VEHICLES; ++i) {
- if(GetVehicleModel(i)) {
- GetVehicleVelocity(i, x, y, z);
- gMetrosRodados[i] += (floatround(floatsqroot(x*x + y*y + z*z ) * 180 / 3.6));
- }
- }
- return true;
- }
- // -----------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement