/lights won't work properly
#1

My /lights command is bugged. When ever I type /lights, the lights remain the same, they don't turn on, but the gametext is showed correctly. Also, if my lights are set to "on" and I exit my car, the lights turn on. When I enter it again, the lights turn off. Can anyone help me out please?

This is my /lights command
pawn Код:
if(!strcmp(cmd, "/lights", true))
    {
        if(GetPlayerState(playerid) == 2)
        {
            new vid = GetPlayerVehicleID(playerid);
            new engine = 0, light = 0, alarm = 0, doors = 0, bonnet = 0, boot = 0, objective = 0;
            GetVehicleParamsEx(vid, engine, light, alarm, doors, bonnet, boot, objective);
            if(!light)
            {
                GameTextForPlayer(playerid, "~w~Lights ~g~On", 2000, 4);
                SetVehicleParamsEx(vid, engine, 1, alarm, doors, bonnet, boot, objective);
            }
            else
            {
                GameTextForPlayer(playerid, "~w~Lights ~r~Off", 2000, 4);
                SetVehicleParamsEx(vid, engine, 0, alarm, doors, bonnet, boot, objective);
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "[ERROR:] You are not in a vehicle as a driver.");
        }
        return 1;
    }
Reply
#2

Bump, still bugged. I need help on this one please :/

EDIT: I recoded it and still the same thing is happening

pawn Код:
if(strcmp(cmd, "/lights", true) == 0)
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            new vid = GetPlayerVehicleID(playerid);
            new engine = 0, light = 0, alarm = 0, doors = 0, bonnet = 0, boot = 0, objective = 0;
            GetVehicleParamsEx(vid, engine, light, alarm, doors, bonnet, boot, objective);
            if(light == 0)
            {
                GameTextForPlayer(playerid, "~w~Lights ~g~On", 2000, 4);
                SetVehicleParamsEx(vid, engine, 1, alarm, doors, bonnet, boot, objective);
                return 1;
            }
            else
            {
                GameTextForPlayer(playerid, "~w~Lights ~r~Off", 2000, 4);
                SetVehicleParamsEx(vid, engine, 0, alarm, doors, bonnet, boot, objective);
                return 1;
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "[ERROR:] You are not in a vehicle as a driver.");
        }
        return 1;
    }
Reply
#3

With won't work you mean the lights won't turn on or off right?
Use zcmd it's easier to use
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)