Gate opening with Mouse middle button
#1

Hi.
I made this command, it works perfectly when i am not in car, but doesn't work if i'm in car, It just doesn't do anything.
Code is here..
pawn Код:
if ( PRESSED(KEY_LOOK_BEHIND) )
    {
       new pName[64];
        GetPlayerName(playerid,pName,64);
        if(!strcmp(pName,"Steven_Hayen",true))
        {
            if(IsPlayerInRangeOfPoint(playerid, 14,323.3900,-1190.5800,76.0000))
                {
                    if(varav2 == 0)
                    {
                        MoveObject(gate, 321.25000000,-1188.27000000,69.66000000,2.00000000);
                        MoveObject(gate1, 319.14000000,-1190.06000000,68.31000000,2.00000000);
                        MoveObject(gate2, 319.14000000,-1190.06000000,70.48000000,2.000000000);
                        MoveObject(gate3, 321.44000000,-1188.21000000,68.31000000,2.000000000);
                        MoveObject(gate4, 321.45000000,-1188.22000000,70.48000000,2.000000000);
                        SendClientMessage(playerid, COLOR_BLUE,"Gate opened!");
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        varav2 = 1;
                    }
                    else
                    {
                        MoveObject(gate, 321.25000000,-1188.27000000,76.35000000,2.00000000);//CreateObject(971,321.35000000,-1188.27000000,76.35000000,0.00000000,0.00000000,38.33000000);
                        MoveObject(gate1, 319.14000000,-1190.06000000,75.00000000,2.00000000);
                        MoveObject(gate2, 319.14000000,-1190.06000000,77.17000000,2.00000000);
                        MoveObject(gate3, 321.44000000,-1188.21000000,75.00000000,2.00000000);
                        MoveObject(gate4, 321.45000000,-1188.22000000,77.17000000,2.00000000);
                        SendClientMessage(playerid, COLOR_BLUE,"Gate closed!");
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        varav2 = 0;
                    }
                }
            }
Reply
#2

anybody?
Reply
#3

No, sorry, don't think its possible with the mouse button.
Reply
#4

But with any other buttons?
Reply
#5

It is possible for in and out of a vehicle, and i don't really see anything wrong with the key-check.
Reply
#6

Okey, you're possible right.
Reply
#7

Try with other buttons

GetPlayerKeys
Reply
#8

Well, I'm not totally sure if this is for a gamepad, but for so far I know this is the look behind key for vehicles:
pawn Код:
KEY_ANALOG_DOWN
So, you could try this:
pawn Код:
if ( PRESSED(KEY_LOOK_BEHIND) || PRESSED(KEY_ANALOG_DOWN) )
Reply
#9

well dude the idea is very awesome but lets see it will work or nt ^^
Reply
#10

As I know KEY_LOOK_BEHIND is E, or Q. (I can't remember)

And KEY_ANALOG_DOWN is 2
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)