Lights command issue
#1

Well I am experiencing some issues with my /lights command, here it is

pawn Код:
CMD:lights(playerid, params[]) {
    new vehicleid = GetPlayerVehicleID(playerid);
    new engine, lights, alarm, doors, bonnet, boot, objective;

    if(GetPlayerState(playerid) == 2)
    {
        if(playerVariables[playerid][pCarLights] == 1) return SendClientMessage(playerid, COLOR_RED,"ERROR: The vehicle's hood is already opened!");
        if(IsPlayerInAnyVehicle(playerid)) {
            switch(playerVariables[playerid][pCarLights]) {
                case 0: {
                    playerVariables[playerid][pCarLights] = 1;
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(vehicleid,engine,true,alarm,doors,bonnet,boot,objective);
                    format(szMessage, sizeof(szMessage), "* %s has pushed a button on his steering wheel, turning on their headlights.", szPlayerName);
                    nearByMessage(playerid, COLOR_PURPLE, szMessage);
                }
                default: {
                    playerVariables[playerid][pCarLights] = 0;
                    GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);//this will check that what is the state of engine.That is is on or off.We can use it for multiple things like doors,alarms etc.But In this case I am using this for the engine only.
                    SetVehicleParamsEx(vehicleid,engine,false,alarm,doors,bonnet,boot,objective);
                    format(szMessage, sizeof(szMessage), "* %s has pushed a button on his steering wheel, turning off their headlights.", szPlayerName);
                    nearByMessage(playerid, COLOR_PURPLE, szMessage);
                }
            }
        }
    }
    return 1;
}
This command works for any other type of part... I have /hood, /trunk, /engine and etc and it works fine but not lights. Any ideas?
Reply


Messages In This Thread
Lights command issue - by Swyft™ - 26.10.2012, 14:50
Re: Lights command issue - by Swyft™ - 26.10.2012, 15:24
Re: Lights command issue - by Swyft™ - 26.10.2012, 16:07
Re: Lights command issue - by Swyft™ - 26.10.2012, 18:39
Re: Lights command issue - by gtakillerIV - 26.10.2012, 19:30
Re: Lights command issue - by Swyft™ - 26.10.2012, 19:35
Re: Lights command issue - by Catalyst- - 26.10.2012, 19:37
Re: Lights command issue - by Swyft™ - 26.10.2012, 19:42
Re: Lights command issue - by gtakillerIV - 26.10.2012, 19:44
Re: Lights command issue - by Catalyst- - 26.10.2012, 19:44

Forum Jump:


Users browsing this thread: 1 Guest(s)