SA-MP Forums Archive
[Ayuda] Como hago para que no exploten mis vehiculos.. - 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: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: [Ayuda] Como hago para que no exploten mis vehiculos.. (/showthread.php?tid=356589)



[Ayuda] Como hago para que no exploten mis vehiculos.. - dgor - 04.07.2012

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.


Respuesta: [Ayuda] Como hago para que no exploten mis vehiculos.. - OTACON - 04.07.2012

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



Respuesta: [Ayuda] Como hago para que no exploten mis vehiculos.. - Bu11Sh0t - 04.07.2012

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



Respuesta: [Ayuda] Como hago para que no exploten mis vehiculos.. - CaptainMactavish - 04.07.2012

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.


Respuesta: [Ayuda] Como hago para que no exploten mis vehiculos.. - dgor - 25.07.2012

Muchas gracias me sirvio de mucho :P