SA-MP Forums Archive
How can I make the bikes 'engine' be turned on when they spawn/ respawn? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How can I make the bikes 'engine' be turned on when they spawn/ respawn? (/showthread.php?tid=491397)



How can I make the bikes 'engine' be turned on when they spawn/ respawn? - Don_Cage - 30.01.2014

Well the title says it all..
I've tried this under OnVehicle Spawn
pawn Код:
if(IsModelABycicle(vehicleid))
    {
        new engine,lights,alarm,doors,bonnet,boot,objective;
        GetVehicleParamsEx(GetPlayerVehicleID(vehicleid),engine,lights,alarm,doors,bonnet,boot,objective);
        SetVehicleParamsEx(GetPlayerVehicleID(vehicleid),VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
        engineOn[GetPlayerVehicleID(vehicleid)] = true;
        gEngine[vehicleid] = true;
        engineOn[vehicleid] = true;
        return 1;
    }
But no success..


Re: How can I make the bikes 'engine' be turned on when they spawn/ respawn? - MrTinder - 30.01.2014

Do you have a stock or public named 'IsModelABycicle'?


Re: How can I make the bikes 'engine' be turned on when they spawn/ respawn? - Don_Cage - 30.01.2014

pawn Код:
public IsModelABycicle(carid)
{
    new modelid = GetVehicleModel(carid);
    if(modelid == 509 || modelid == 481 || modelid == 510)
    {
        return 1;
    }
    return 0;
}



Re: How can I make the bikes 'engine' be turned on when they spawn/ respawn? - ProjectMan - 30.01.2014

pawn Код:
if(IsModelABycicle(vehicleid))
    {
        new engine,lights,alarm,doors,bonnet,boot,objective;
        GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
        SetVehicleParamsEx(vehicleid,1,lights,alarm,doors,bonnet,boot,objective);
        engineOn[vehicleid] = true;
        gEngine[vehicleid] = true;
        engineOn[vehicleid] = true;
        return 1;
    }