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


Messages In This Thread
SetVehicleParamasEx Little help. - by ricardo178 - 08.06.2011, 18:23
Re: SetVehicleParamasEx Little help. - by ricardo178 - 08.06.2011, 18:51
Re: SetVehicleParamasEx Little help. - by iGetty - 08.06.2011, 20:20
Re: SetVehicleParamasEx Little help. - by ricardo178 - 08.06.2011, 20:32
Re: SetVehicleParamasEx Little help. - by iGetty - 08.06.2011, 20:57

Forum Jump:


Users browsing this thread: 1 Guest(s)