[Include] OnPlayerKnifePlayer - OPKP.inc
#21

Thanks for the clarification. How-ever, I believe it'd be an easier spoof since it's called when damage is given, which now-a-days can be spoofed easily whereas animations, etc isn't so easy.
Reply
#22

Checking the animation can cause false negatives too. Consider this:

A = killer
B = player getting knifed

if A knives B, and only B sees the throat slitting animation. on A's screen he's not knifing. B dies. In this case your include would fail where with OnPlayerGiveDamage it would get picked up.

I don't know if it's harder to spoof animation, though it's definitely less mainstream. Obviously you can do whatever you want, it's your include, and I hope I don't seem pushy to you to change your include.
Reply
#23

Quote:
Originally Posted by Whitetiger
Посмотреть сообщение
Checking the animation can cause false negatives too. Consider this:

A = killer
B = player getting knifed

if A knives B, and only B sees the throat slitting animation. on A's screen he's not knifing. B dies. In this case your include would fail where with OnPlayerGiveDamage it would get picked up.

I don't know if it's harder to spoof animation, though it's definitely less mainstream. Obviously you can do whatever you want, it's your include, and I hope I don't seem pushy to you to change your include.
I will probably end up making a version with the option of which method to use. If I do make that sort-of update it will most likely be released tomorrow or later.
Reply
#24

Updated.
Reply
#25

Simple yet useful, good job +rep
Reply
#26

Thank you. If you have any suggestions; or (CONSTRUCTIVE) criticism it'd be much appreciated.
Reply
#27

Would this work?
pawn Код:
public OnPlayerKnifePlayer(playerid, targetid)
{
    if(GetPlayerTeam(playerid) == GetPlayerTeam(targetid))
    {
        return GameTextForPlayer(playerid, "~r~Don't back-stab team mates!", 5000, 3);
    }
    return 1;
}
or will it kill the player either way?
Reply
#28

OnPlayerKnifePlayer is called before the damage is called; so I imagine by doing something like this, the worst it would do is cause the slide bug.

pawn Код:
public OnPlayerKnifePlayer(playerid, targetid)
{
    if(GetPlayerTeam(playerid) == GetPlayerTeam(targetid))
    {
           GameTextForPlayer(playerid, "~r~Don't back-stab team mates!", 5000, 3);
           new Float: pos[3];
           GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
           SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
           ClearAnimations(playerid);
           return ClearAnimations(targetid);
    }
    return 1;
}
I will look into being able to return 0 or something to stop the stab.
Reply
#29

Using ClearAnimations should prevent it from happening(if you clear animations of both the playerid, and targetid). I will test this soon.
Reply
#30

Yes; that does work. While testing, I encountered a small bug, which I believe should be fixed now. The new version can be found here.

I have also added a simple "StopStab" function to stop the player from stabbing the targetID. Simply place it with the according parameters in the OnPlayerKnifePlayer callback to stop a player from stabbing them.
Reply
#31

Just going to say that Slices damage include covers all knife issues and all lagcomp issues this is not the way to go.
Reply
#32

Quote:
Originally Posted by Pottus
Посмотреть сообщение
Just going to say that Slices damage include covers all knife issues and all lagcomp issues this is not the way to go.
This was made previous to the release of his include for reference. I also believe Kar that I am currently hooking OnPlayerUpdate though I haven't looked at the code in a while.
Reply
#33

I understand was just point out it's old and there is better methods that cover this issue and a wide ranger of others.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)