27.06.2015, 01:29
Hello, I'm in doubt, I have a code here, is used in a public SA-MP, is as follows, if the person hit with a vehicle and be with the seat belt:
I wanted to make this function is valid for the driver and passengers at this time is only for drivers, as I do for the passenger receive the same function (For example, the person hits a vehicle, to and all the vehicle receiving function) ? very complex, going beyond the SA-MP! ..
PHP код:
VerificarVelocidade(playerid); //This function is called only when the driver or passenger is without the belt
PHP код:
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerInVehicle(i, vehicleid))
{
if (CintoPlayerid[i] == 0)
{
VerificarVelocidade(playerid);
}
else if (Capacetes[i] == 0 && IsAMotos(GetPlayerVehicleID(i)))
{
VerificarVelocidade(playerid);
}
}
}
}