[Ayuda] Como hago para que no exploten mis vehiculos..
#1

Saludos a todos me podrian ayudar con el code para hacer que los autos no exploten?

Mas especificaciones: Me gustaria que si el auto llega al punto en que empieza a prenderse en llamas se detenga y no explote y que al mismo tiempo se apague el motor, no quiero que se autorepare sino se quede en ese estado hasta que venga un mecanico y lo repare

Gracias de antemano la ayuda a este novato.
Reply
#2

pawn Код:
SetTimer("vidavehiculo", 1000, true);

forward vidavehiculo(playerid);
public vidavehiculo(playerid)
{
    new Float:health;
    new veh;
    veh = GetPlayerVehicleID(playerid);
    GetVehicleHealth(veh, health);
    if(health < 30.0)
    {
        SendClientMessage(playerid, -1, "    [ ! ] el vehiculo esta daсado,  llame a un mecanico!.");
    }
    return 1;
}
Reply
#3

pawn Код:
forward OnUpdate();
public OnUpdate()
{
    for(new v = 0; v < MAX_VEHICLES; v++)
    {
        new Float:health;
        GetVehicleHealth(v, health);
        if(health < 251)
        {
            SetVehicleParamsEx(v, 0, 0, 0, 1, 0, 0, 0);
            SetVehicleHealth(v, 251);
        }
    }
}
y en OnGameModeInit
pawn Код:
SetTimer("OnUpdate", 1000, 1);
Reply
#4

Quote:
Originally Posted by Bu11Sh0t
Посмотреть сообщение
pawn Код:
forward OnUpdate();
public OnUpdate()
{
    for(new v = 0; v < MAX_VEHICLES; v++)
    {
        new Float:health;
        GetVehicleHealth(v, health);
        if(health < 251)
        {
            SetVehicleParamsEx(v, 0, 0, 0, 1, 0, 0, 0);
            SetVehicleHealth(v, 251);
        }
    }
}
y en OnGameModeInit
pawn Код:
SetTimer("OnUpdate", 1000, 1);
El cуdigo es correcto, sin embargo, estбs loopeando 2000 vehнculos, serнa suficiente solo si loopearнas los autos que estбn siendo conducidos por jugadores.
Reply
#5

Muchas gracias me sirvio de mucho :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)