16.06.2015, 16:52
PHP код:
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i) && IsPlayerInVehicle(i, vehicleid))
{
if (CintoPlayerid[i] == 0)
{
VerificarVelocidade(playerid);
}
else if (Capacetes[i] == 0 && IsAMotos(GetPlayerVehicleID(i)))
{
VerificarVelocidade(playerid);
}
}
}
return 1;
}
VerificarVelocidade(i)
{
new Float: health;
if (GetPlayerSpeed(i, true) >= 50)
{
GetPlayerHealth(i, health);
SetPlayerHealth(i, health - 7);
}
else if (GetPlayerSpeed(i, true) >= 70)
{
GetPlayerHealth(i, health);
SetPlayerHealth(i, health - 15);
}
else if (GetPlayerSpeed(i, true) >= 110)
{
GetPlayerHealth(i, health);
SetPlayerHealth(i, health - 20);
}
else if (GetPlayerSpeed(i, true) >= 150)
{
GetPlayerHealth(i, health);
SetPlayerHealth(i, health - 30);
}
else if (GetPlayerSpeed(i, true) >= 170)
{
GetPlayerHealth(i, health);
SetPlayerHealth(i, health - 35);
}
return 1;
}
@edit
Up!