[Help] Enterance
#1

So in my script I can enter and exit from houses,business and all that using /enter and /exit,can anyone explain me how to set it that you can enter and exit using the key "F",I need it really bad,thanks.
Reply
#2

OnPlayerKeyStateChange
enough said
Reply
#3

Quote:
Originally Posted by PaulDinam
Посмотреть сообщение
OnPlayerKeyStateChange
enough said
*Claps*
Don't bother helping if that's your way of helping. I bet you won't appreciate it yourself if people did that with you.

I will continue with what he stated.
You will need to check if the player presses the F button when he's in range of any business/house entrance.

That check is triggered with "OnPlayerKeyStateChange".
I recommend you to browse through the Sa-MP wiki and see how the callback is used.

Here's an example code:
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys == KEY_ACTION) // I think this is the "F" key (by default)
    {
        //do something here
    }
    return 1;
}
Here are the links to the SA-MP wiki:

https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
https://sampwiki.blast.hk/wiki/Keys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)