Key_Submission
#1

Hello,

I have this code in KEY_SUBMISSION but i press the key and dont work.
pawn Код:
else if(PRESSED(KEY_SUBMISSION))
    {
        if (IsPlayerInAnyVehicle(playerid))
        {
            new vid = GetPlayerVehicleID(playerid);
            GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
            if(lights != 1)
            {
                SetVehicleParamsEx(vid,engine,1,alarm,doors,bonnet,boot,objective);
                SendClientMessage(playerid, COLOR_WHITE, "Ligas-te as Luzes!");
            }
            else
            {
                SetVehicleParamsEx(vid,engine,0,alarm,doors,bonnet,boot,objective);
                SendClientMessage(playerid, COLOR_WHITE, "Desligas-te as Luzes!");
            }
            return 1;
        }
    }
Can you help me?
Reply
#2

You're pressing the right key? Also, learn how to debug (god, I should write a tutorial about that). Add prints and see what's being called and what not.
Reply
#3

That Code above dont work.

But now this code, works if i press 2(Numpad) and +(Numpad).
pawn Код:
else if(newkeys == KEY_SUBMISSION)
    {
        if (IsPlayerInAnyVehicle(playerid))
        {
            new vid = GetPlayerVehicleID(playerid);
            GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
            if(lights != 1)
            {
                SetVehicleParamsEx(vid,engine,1,alarm,doors,bonnet,boot,objective);
                SendClientMessage(playerid, COLOR_WHITE, "Ligas-te as Luzes!");
            }
            else
            {
                SetVehicleParamsEx(vid,engine,0,alarm,doors,bonnet,boot,objective);
                SendClientMessage(playerid, COLOR_WHITE, "Desligas-te as Luzes!");
            }
        }
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)