Players undable to climb and jump
#1

Hello everyone. My question it's simple. How can I make a player unable to jump or climb? About the climbing, I saw something like getting the special action and then canceling the animation.
Reply
#2

You could use key-presses. Be Creative.
Reply
#3

Quote:
Originally Posted by Abagail
Посмотреть сообщение
You could use key-presses. Be Creative.
That should work but I wasn't (am not) really sure what to choose between OnPlayerKeyStateChange and OnPlayerUpdate...
Reply
#4

I think I tried to make something like this before. Using OnPlayerKeyStateChange (Basically getting their position and setting them to it - aka not allowing the velocity increase was a method I found to work).

Try if this works (I think this is how the code should be):

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_JUMP)
    {
        new Float:x, Float:y, Float:z;
       
        GetPlayerPos(playerid, x, y, z);
        SetPlayerPos(playerid, x, y, z);
    }
    return 1;
}
EDIT: You could've just asked me on Skype.
Reply
#5

Quote:
Originally Posted by Mionee
Посмотреть сообщение
I think I tried to make something like this before. Using OnPlayerKeyStateChange (Basically getting their position and setting them to it - aka not allowing the velocity increase was a method I found to work).

Try if this works (I think this is how the code should be):

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_JUMP)
    {
        new Float:x, Float:y, Float:z;
       
        GetPlayerPos(playerid, x, y, z);
        SetPlayerPos(playerid, x, y, z);
    }
    return 1;
}
EDIT: You could've just asked me on Skype.
And Mionee saves the situation again ^-^ This is exactly and I mean EXACTLY what I was looking for. Thanks everyone :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)