CMD:godcar(playerid, params[])
{
new vid;
vid = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid))
if(!GodCar[playerid])
{
GodCar[playerid] = 1;
SendClientMessage(playerid, Vermelho, "Carro Em Godcar!");
SetVehicleHealth(playerid, cellmax);
RepairVehicle(vid);
}
else if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, Vermelho, "Vocк nгo estб em 1 carro");
if(GodCar[playerid])
{
SendClientMessage(playerid, Vermelho, "Seu Carro ja Estб Em GodCar D:");
}
return true;
}
Use esta callback: https://sampwiki.blast.hk/wiki/OnVehicleDamageStatusUpdate
|
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
new vid;
vid = GetPlayerVehicleID(playerid);
if(GodCar[playerid])
{
RepairVehicle(vid);
}
return 1;
}
Obrigado cara, Resolveu meus problemas, bastou eu por:
pawn Код:
|
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
if(GodCar[playerid])
{
RepairVehicle(vehicleid);
}
return 1;
}