SA-MP Forums Archive
Gate opening with Mouse middle button - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Gate opening with Mouse middle button (/showthread.php?tid=254748)



Gate opening with Mouse middle button - pliptm - 12.05.2011

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;
                    }
                }
            }



Re: Gate opening with Mouse middle button - pliptm - 12.05.2011

anybody?


Re: Gate opening with Mouse middle button - lowrida018 - 12.05.2011

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


Re: Gate opening with Mouse middle button - pliptm - 13.05.2011

But with any other buttons?


Re: Gate opening with Mouse middle button - Mike Garber - 13.05.2011

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


Re: Gate opening with Mouse middle button - pliptm - 13.05.2011

Okey, you're possible right.


Re: Gate opening with Mouse middle button - Laronic - 13.05.2011

Try with other buttons

GetPlayerKeys


Re: Gate opening with Mouse middle button - Biesmen - 13.05.2011

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) )



Re: Gate opening with Mouse middle button - wheelman_WM - 13.05.2011

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


Re: Gate opening with Mouse middle button - Gh0sT_ - 13.05.2011

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

And KEY_ANALOG_DOWN is 2