[Help] Moving gate - Two clicks - 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)
+--- Thread: [Help] Moving gate - Two clicks (
/showthread.php?tid=425707)
[Help] Moving gate - Two clicks -
Riven - 26.03.2013
Hello , I'm new on scripting and I wanted to ask about something , making a moving gate with a button , how to do it ? I searched a bit , got 2 things ..
1st :
https://sampforum.blast.hk/showthread.php?tid=278880
2nd :
https://sampforum.blast.hk/showthread.php?tid=303153
1st one didn't work and second one had a problem , with every key I press it opened the gate , not the specified key ..
Another thing , how can I make the gate open with 2 clicks , like if i press left click twice it will open the gate , not only once and thanks.
Re: [Help] Moving gate - Two clicks -
glbracer - 26.03.2013
How are you detecting the clicks? And which button is it?
Re: [Help] Moving gate - Two clicks -
Riven - 26.03.2013
Sorry , but what do you mean by "detecting the clicks" ? :/ and i did it as the MMB , I got the code for it from wiki I think it was something like KEY_LOOK_BEHIND
Re: [Help] Moving gate - Two clicks -
glbracer - 26.03.2013
Yeah, you should use OnPlayerKeyStateChange for this.
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if((newkeys & KEY_LOOK_BEHIND) && !(oldkeys & KEY_LOOK_BEHIND))
{
// Then execute the code, think about how it could be done.
}
}
Re: [Help] Moving gate - Two clicks -
Riven - 26.03.2013
That means the gate will open with 2 clicks of MMB?
Re: [Help] Moving gate - Two clicks -
Riddick94 - 26.03.2013
https://sampwiki.blast.hk/wiki/OnPlayerK..._being_pressed