SA-MP Forums Archive
Animation index. - 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: Animation index. (/showthread.php?tid=371606)



Animation index. - BaubaS - 23.08.2012

Hey, I am making anti-airbrake/tp script. It's almost done, I only need animation index id when player jumps out of the car when it goes fast. I tried to debug it with OPEV, but it always return 0 somewhy. Also, if possible IsCarFalling, sometimes when car falls it detects it as airbrake.

Thanks.


Re: Animation index. - Shetch - 23.08.2012

I don't know about the animation, but the IsCarFalling thing is pretty impossible...


Re: Animation index. - MP2 - 24.08.2012

Look in test_cmds.pwn - a filterscript that comes with the SA:MP server.

IsCarFalling is piss-easy - get the vehicle velocity (GetVehicleVelocity) and if the Z is quite low (not sure how low - make a test command) they're falling.


Re: Animation index. - BaubaS - 24.08.2012

Quote:
Originally Posted by MP2
Посмотреть сообщение
Look in test_cmds.pwn - a filterscript that comes with the SA:MP server.

IsCarFalling is piss-easy - get the vehicle velocity (GetVehicleVelocity) and if the Z is quite low (not sure how low - make a test command) they're falling.
Look in that filterscript for what?

And yes, Im going to make some test tommorow (about the velocity)


Re: Animation index. - Shetch - 24.08.2012

Quote:
Originally Posted by MP2
Посмотреть сообщение
Look in test_cmds.pwn - a filterscript that comes with the SA:MP server.

IsCarFalling is piss-easy - get the vehicle velocity (GetVehicleVelocity) and if the Z is quite low (not sure how low - make a test command) they're falling.
Oh, I'm not familiar with GetVehicleVelocity, sorry.


Re: Animation index. - grand.Theft.Otto - 24.08.2012

https://sampwiki.blast.hk/wiki/GetVehicleVelocity


Re: Animation index. - Shetch - 24.08.2012

Код:
public OnPlayerUpdate(playerid)
{
    if(GetPlayerAnimationIndex(playerid))
    {
        new animlib[32];
        new animname[32];
        new msg[128];
        GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
        format(msg, 128, "Running anim: %s %s", animlib, animname);
        SendClientMessage(playerid, 0xFFFFFFFF, msg);
    }
    return 1;
}
Credits: Wiki