02.01.2016, 02:24
PHP код:
new Float: Veh[MAX_VEHICLES];
stock Hook_SetVehicleHealth(vehicleid, Float:health) {
SetVehicleHealth(vehicleid, health);
Veh[vehicleid] = health;
return 1;
}
stock Hook_RepairVehicle(vehicleid) {
RepairVehicle(vehicleid);
Veh[vehicleid] = 1000;
return 1;
}
#if defined _ALS_SetVehicleHealth
#undef SetVehicleHealth
#else
#define _ALS_SetVehicleHealth
#endif
#define SetVehicleHealth Hook_SetVehicleHealth
#if defined _ALS_RepairVehicle
#undef RepairVehicle
#else
#define _ALS_RepairVehicle
#endif
#define RepairVehicle Hook_RepairVehicle
public OnVehicleSpawn(vehicleid) {
GetVehicleHealth(vehicleid, Veh[vehicleid]);
return 1;
}
public OnVehicleDamageStatusUpdate(vehicleid, playerid) {
new Float:vida;
GetVehicleHealth(vehicleid, vida);
if ( cinto[playerid] == 0 ) {
if ( ( Veh[vehicleid] - vida ) < 100.0 ) {
Veh[vehicleid] = vida;
GetPlayerHealth(playerid, vida);
SetPlayerHealth(playerid, ( vida - 0.0001) );
SendClientMessage(playerid,COLOR_YELLOW,"[Aviso]: Vocк bateu com seu veнculo, e por nгo estar usando o cinto, acabou se machucando.");
}
else {
Veh[vehicleid] = vida;
GetPlayerHealth(playerid, vida);
SetPlayerHealth(playerid, ( vida - 1.0 ) );
SendClientMessage(playerid,COLOR_YELLOW,"[Aviso]: Vocк bateu com seu veнculo, e por nгo estar usando o cinto, acabou se machucando.");
}
}
return 1;
}