SA-MP Forums Archive
[Ajuda] Comando /GodCar - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Comando /GodCar (/showthread.php?tid=413095)



Comando /GodCar - Equipe - 04.02.2013

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



Re: Comando /GodCar - zSuYaNw - 04.02.2013

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


Re: Comando /GodCar - Equipe - 04.02.2013

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;
}



Re: Comando /GodCar - zSuYaNw - 04.02.2013

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;
}