[Help] Moving gate - Two clicks
#1

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.
Reply
#2

How are you detecting the clicks? And which button is it?
Reply
#3

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
Reply
#4

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.
    }
}
Reply
#5

That means the gate will open with 2 clicks of MMB?
Reply
#6

https://sampwiki.blast.hk/wiki/OnPlayerK..._being_pressed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)