Engine off OnVehicleSpawn
#1

------
Reply
#2

We need to see some code to help...

Also if you want it off, you'll need a:

pawn Код:
new engine, lights, alarm, doors, bonnet, boot, objective;    
new vid = GetPlayerVehicleID(playerid);    
GetVehicleParamsEx(vid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vid, 0, lights, alarm, doors, bonnet, boot, objective);
Reply
#3

------
Reply
#4

Hmm, I'm a bit confused what the problem is exactly. I assume you mean that it doesn't work at all... ("doesnt turn the engine off of the vehicle when it spawns" ... spawns in the beginning?)

But this would fix it, it will ignore the variable (if it's bugged) and force it on or off:
pawn Код:
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(engine != 1)//Checks the engine status rather than the variable
{
            new engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
            Engine[vehicle] = 1;
            SetVehicleParamsEx(vehicle, 1, lights, alarm, doors, bonnet, boot, 0);
}
else return SendClientMessage(playerid, COLOR_GREY, "This vehicle's engine is already off.");
Reply
#5

------
Reply
#6

pawn Код:
public OnVehicleSpawn(vehicleid)
{
    new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
    SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
    return 1;
}
Reply
#7

------
Reply
#8

------
Reply
#9

ManualVehicleEngineAndLights();
Ongamemodeinit.
Reply
#10

------
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)