SA-MP Forums Archive
I need a Imposible Function!! #2 - 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: I need a Imposible Function!! #2 (/showthread.php?tid=396552)



I need a Imposible Function!! #2 - dr.lozer - 01.12.2012

I need a function that get player anim

if player using (killing with knife from behind) return true;
else return false; XDDDDDDD


Re: I need a Imposible Function!! #2 - Bicentric - 01.12.2012

pawn Код:
stock IsPlayerKillingWithKnife(playerid)
{
    if(GetPlayerAnimationIndex(playerid) == KnifeKillAnim) return true;
    return false;
}
Replace 'KnifeKillAnim' with the animation ID. I don't know what ID it is for killing behind. I don't work with animations a lot, so I am not certain that it will work, but it compiles just fine if I put in a valid animation ID.


Re: I need a Imposible Function!! #2 - dr.lozer - 01.12.2012

Quote:
Originally Posted by Bicentric
Посмотреть сообщение
pawn Код:
stock IsPlayerKillingWithKnife(playerid)
{
    if(GetPlayerAnimationIndex(playerid) == KnifeKillAnim) return true;
    return false;
}
Replace 'KnifeKillAnim' with the animation ID. I don't know what ID it is for killing behind. I don't work with animations a lot, so I am not certain that it will work, but it compiles just fine if I put in a valid animation ID.
i need the id too -_-


Re: I need a Imposible Function!! #2 - Konstantinos - 01.12.2012

The knife animations
pawn Код:
KILL_Knife_Ped_Damage
KILL_Knife_Ped_Die
KILL_Knife_Player
KILL_Partial
knife_1
knife_2
knife_3
Knife_4
knife_block
Knife_G
knife_hit_1
knife_hit_2
knife_hit_3
knife_IDLE
knife_part
WEAPON_knifeidle



Re: I need a Imposible Function!! #2 - dr.lozer - 01.12.2012

Hey Dwane i want the Anim that when player Kill player in ninja style! ( like in SP in mission stealing the book in madd ddog's book ) XD

you know what im saying


Re: I need a Imposible Function!! #2 - Virtual1ty - 01.12.2012

Use Bicentric's function skeleton, and place in the ID that you find, you can use this handy little snippet to do it yourself:
pawn Код:
public OnPlayerUpdate(playerid)
{
    static index;
    index = GetPlayerAnimationIndex(playerid);
   
    if (index)
    {
        new animlib[32], animname[32], msg[128];
        GetAnimationName(index, animlib, 32, animname, 32);
        format(msg, 128, "Running animation: %s/%s, index: %d", animlib, animname, index);
        SendClientMessage(playerid, 0xFFFFFFFF, msg);
    }
    return 1;
}
Checking just the animation index is better and a little faster than slowly comparing the animations name.
Just put this in your mode and compile. As soon as you spawn, you will get spammed with Running animation: messages, so just get a player on your server and knife him from behind. Then check your chatlog for the animation index.


Re: I need a Imposible Function!! #2 - [MM]RoXoR[FS] - 01.12.2012

you will get full list of animation here


Re: I need a Imposible Function!! #2 - dr.lozer - 01.12.2012

Quote:
Originally Posted by [MM]RoXoR[FS]
Посмотреть сообщение
you will get full list of animation here
Dude, i dont know the one i need from that all :3