21.08.2012, 22:42
Toma
Mude o nome da sua Float de Salvamento caso tiver de health para Vida
pawn Код:
forward Carro(playerid,vehicleid,Vida);
public Carro(playerid,vehicleid,Vida)
{
new Float:Vida;
new veh;
veh = GetPlayerVehicleID(playerid);
GetVehicleHealth(veh, Vida);
new engine, lights, alarm, doors, bonnet, boot, objective;
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(Vida < 10)
{
if(IsPlayerInAnyVehicle(playerid))
{
TogglePlayerControllable(playerid, 0);
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 0, 0, alarm, doors, bonnet, boot, objective);
}
}
if(Vida > 10)
{
if(IsPlayerInAnyVehicle(playerid))
{
TogglePlayerControllable(playerid, 1);
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 1, 1, alarm, doors, bonnet, boot, objective);
}
}
}
return true;
}