Problem with SetVehicleParamsEx
#1

Hey,

I have never used SetVehicleParamsEx before, I have the engine, hood, boot, and alarm all working however the rest don't.

Am I doing this correctly:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == Dialog_Settings)
    {
        if(!response) return SendClientMessage(playerid, COLOR_RED, "You have cancelled your selection.");
        new engine, lights, alarm, doors, bonnet, boot, objective;
        new VehicleID = GetPlayerVehicleID(playerid);
        switch(listitem)
        {
            case 0:
            {
                if(EngineOn[VehicleID] == false)
                {
                    SetVehicleParamsEx(VehicleID, true, lights, alarm, doors, bonnet, boot, objective);
                    EngineOn[VehicleID] = true;
                }
                else if(EngineOn[VehicleID] == true)
                {
                    SetVehicleParamsEx(VehicleID, false, lights, alarm, doors, bonnet, boot, objective);
                    EngineOn[VehicleID] = false;
                }
            }
            case 1:
            {
                if(LightsOn[VehicleID] == false)
                {
                    SetVehicleParamsEx(VehicleID, engine, true, alarm, doors, bonnet, boot, objective);
                    LightsOn[VehicleID] = true;
                }
                else if(LightsOn[VehicleID] == true)
                {
                    SetVehicleParamsEx(VehicleID, engine, false, alarm, doors, bonnet, boot, objective);
                    LightsOn[VehicleID] = false;
                }
            }
            case 2:
            {
                if(AlarmOn[VehicleID] == false)
                {
                    SetVehicleParamsEx(VehicleID, engine, lights, true, doors, bonnet, boot, objective);
                    AlarmOn[VehicleID] = true;
                }
                else if(AlarmOn[VehicleID] == true)
                {
                    SetVehicleParamsEx(VehicleID, engine, lights, false, doors, bonnet, boot, objective);
                    AlarmOn[VehicleID] = false;
                }
            }
            case 3:
            {
                if(DoorsOn[VehicleID] == false)
                {
                    SetVehicleParamsEx(VehicleID, engine, lights, alarm, true, bonnet, boot, objective);
                    DoorsOn[VehicleID] = true;
                }
                else if(DoorsOn[VehicleID] == true)
                {
                    SetVehicleParamsEx(VehicleID, engine, lights, alarm, false, bonnet, boot, objective);
                    DoorsOn[VehicleID] = false;
                }
            }
            case 4:
            {
                if(BonnetOn[VehicleID] == false)
                {
                    SetVehicleParamsEx(VehicleID, engine, lights, alarm, doors, true, boot, objective);
                    BonnetOn[VehicleID] = true;
                }
                else if(BonnetOn[VehicleID] == true)
                {
                    SetVehicleParamsEx(VehicleID, engine, lights, alarm, doors, false, boot, objective);
                    BonnetOn[VehicleID] = false;
                }
            }
            case 5:
            {
                if(BootOn[VehicleID] == false)
                {
                    SetVehicleParamsEx(VehicleID, engine, lights, alarm, doors, bonnet, true, objective);
                    BootOn[VehicleID] = true;
                }
                else if(BootOn[VehicleID] == true)
                {
                    SetVehicleParamsEx(VehicleID, engine, lights, alarm, doors, bonnet, false, objective);
                    BootOn[VehicleID] = false;
                }
            }
            case 6:
            {
                if(GodCar[playerid] == false)
                {
                    GodCar[playerid] = true;
                }
                else if(GodCar[playerid] == true)
                {
                    GodCar[playerid] = false;
                }
            }
        }
    }
    return 1;
}
Thanks in advance!
Reply
#2

For those that aren't working:
Lights: It should be night to the neons exept you have one function for disabling it (I don't remember which right now)
Doors: Doors if they are set to 1, they are locked. Did you got out the car and try to enter it again?
Reply
#3

Ahh I'm a dumbass :P I thought by doors it would open/close them not lot em :P thanks for your help.
Reply
#4

No problem. Also, about the lights?
Reply
#5

I haven't tested it at night yet, will let you know when I do
Reply
#6

Weird lights seem to turn off my players engine. Why could that be :S? Sorry for double post
Reply
#7

check my tutorial.
Its all about lights, I also wrote how to turn lights on at day there.

https://sampforum.blast.hk/showthread.php?tid=313362
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)