SA-MP Forums Archive
Able to jump but disable climbing? - 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: Able to jump but disable climbing? (/showthread.php?tid=457610)



Able to jump but disable climbing? - RALL0 - 12.08.2013

Is it possible to do such thing? Like that the person can jump but not climb over fences


AW: Able to jump but disable climbing? - NaS - 12.08.2013

Yes it is, but only when you set the player's interior.
In interiors it's possible to jump but not to climb, I do not know any other way.


Re: Able to jump but disable climbing? - davve95 - 12.08.2013

Make so it press "Enter" Every time when jumping, I don't know if it's possible thought.


Re: Able to jump but disable climbing? - FiReAlEx - 12.08.2013

You can check the player's animation on OnPlayerUpdate and found if he's climbing and clear his animation.


Re: Able to jump but disable climbing? - RALL0 - 12.08.2013

Quote:
Originally Posted by FiReAlEx
Посмотреть сообщение
You can check the player's animation on OnPlayerUpdate and found if he's climbing and clear his animation.
How can I do that?


Re: Able to jump but disable climbing? - FiReAlEx - 12.08.2013

Those are the climbing animation's name. The rest should be easy.
CLIMB_idle
CLIMB_jump
CLIMB_jump2fall
CLIMB_jump_B
CLIMB_Pull
CLIMB_Stand
CLIMB_Stand_finish


Re: Able to jump but disable climbing? - RALL0 - 12.08.2013

I really don't get your point, how is that suppose to stop a player from climbing.


Re: Able to jump but disable climbing? - FiReAlEx - 12.08.2013

You check if the player is doing one of this animation on OnPlayerUpdate and then if it's true, you clear his animation with ClearAnimation


Re: Able to jump but disable climbing? - RALL0 - 12.08.2013

So like this?
pawn Код:
public OnPlayerUpdate(playerid)
{
    if(CLIMB_idle || CLIMB_jump ||CLIMB_jump2fall ||CLIMB_jump_B || CLIMB_Pull || CLIMB_Stand || CLIMB_Stand_finish)
    {
    ClearAnimation(playerid);
    }
    return 1;
}



Re: Able to jump but disable climbing? - FiReAlEx - 12.08.2013

pawn Код:
if(GetPlayerAnimationIndex(playerid))
    {
        new animlib[32];
        new animname[32];
        new msg[128];
        GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
        if(!strcmp(animname, "yournames", true)) {
        ClearAnimations(playerid);
        }