SetVehicleParamasEx Little help.
#1

Hello guys. I made my engine system, but the only problem is:

If i use the cmd to turn engine off, it works, if i use the cmd to turn it on, it works but when i enter a car, the engine is allways on....

My code is:

pawn Код:
new engine, lights, alarm, doors, bonnet, boot, objective;
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new vid = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
    SendClientMessage(playerid, 0xFF00CC, "Use /ste to start the vehicle engine.");
    return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
    new vid = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
    SendClientMessage(playerid, 0xFF00CC, "You turned the engine off.");
    return 1;
}
COMMAND:ste(playerid, param[])
{
    new vid = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
    SendClientMessage(playerid, 0xFF00CC, "Engine Started. Use /spe to turn the vehicle engine off again.");
    return 1;
}
COMMAND:spe(playerid, param[])
{
    new vid = GetPlayerVehicleID(playerid);
    GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
    SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
    SendClientMessage(playerid, 0xFF00CC, "Engine Stoped. Use /ste to turn the vehicle engine on again.");
    return 1;
}
I want it to turn the engine off when someone enter a car.
Reply
#2

Why no-one help me? Is it so hard?
Reply
#3

Under OnGameModeInit();

pawn Код:
ManualVehicleEngineAndLights();
Reply
#4

Thank you very much. It is solved now.
Reply
#5

Good matey Need anymore help, PM me again
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)