[Ajuda] Comando /GodCar
#1

Eu Criei um comando em zcmd:

pawn Код:
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;
}
Gostaria de saber como faзo para quando o carro perder life, automaticamente, reparasse ele
Reply
#2

Use esta callback: https://sampwiki.blast.hk/wiki/OnVehicleDamageStatusUpdate
Reply
#3

Quote:
Originally Posted by [Full]Garfield[XDB]
Посмотреть сообщение
Obrigado cara, Resolveu meus problemas, bastou eu por:

pawn Код:
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
    new vid;
    vid = GetPlayerVehicleID(playerid);
    if(GodCar[playerid])
    {
    RepairVehicle(vid);
    }
    return 1;
}
Reply
#4

Quote:
Originally Posted by Equipe
Посмотреть сообщение
Obrigado cara, Resolveu meus problemas, bastou eu por:

pawn Код:
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
    new vid;
    vid = GetPlayerVehicleID(playerid);
    if(GodCar[playerid])
    {
    RepairVehicle(vid);
    }
    return 1;
}
Nгo precisa pegar o id do veiculo.

pawn Код:
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
    if(GodCar[playerid])
    {
        RepairVehicle(vehicleid);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)