new
Float:kilometer[MAX_VEHICLES];
stock GetVehicleSpeed( vehicleid ) {
new Float:vSpeed[3];
GetVehicleVelocity( vehicleid, vSpeed[0], vSpeed[1], vSpeed[2] );
new Float:vSpeed_Float;
vSpeed_Float = floatsqroot( ((vSpeed[0] * vSpeed[0]) + (vSpeed[1] * vSpeed[1])) + (vSpeed[2] * vSpeed[2])) * 161.0;
new vSpeed_Int;
vSpeed_Int = floatround( vSpeed_Float, floatround_round );
return vSpeed_Int;
}
forward MasodpercesIdozito();
public MasodpercesIdozito()
{
new
playerid = -1,
maxplayers = GetMaxPlayers();
for(;++playerid < maxplayers;)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid) && !GetPlayerVehicleSeat(playerid))
{
kilometer[GetPlayerVehicleID(playerid)] += GetVehicleSpeed(GetPlayerVehicleID(playerid))*0.278;
}
}
}
}
public OnGameModeInit()
{
SetTimer(\"MasodpercesIdozito\", 1000, true);
return true;
}