[FilterScript] [0.3b, 0.3c]Auto Re-sync on knife De-sync
#1

What is knife desync?
Knife desync is when you knife someone on your screen but they do not die and continue moving while appearing to slide along the ground, on their screen you never knifed them so they are just walking around normally. this creates desync in DM environments because you won't see the person who is knifed shooting.

What does this script do?
This script will re-sync the player who has been knifed and is appearing to slide along the ground.

So, how accurate is this script?
I couldn't get it to mess up during testing, but i'm gonna say it'll detect 95% of knife de-sync's

video: [ame]http://www.youtube.com/watch?v=pTzuPYyJmD8[/ame] - no sound, sorry.

v1.0 - http://pawno.pastebin.com/arB9JG9m
v1.1 - http://pawno.pastebin.com/eLq3R89D


Credits:
[___]Whitetiger
Double-O-Seven, niCe, Sief - Aiming functions
Reply
#2

Nice! - However you've left a couple of prints in there, i dont think you're going to want people complaining about having the server log filled with knife anim prints LOL!
Reply
#3

Also, why are you setting a PVar to 0 two times?

pawn Код:
SetPVarInt(targetid, "KnifeKilled", 0);
SetPVarInt(playerid, "KnifeKilled", 0);
SetPVarInt(playerid, "Knifing", 0);
SetPVarInt(targetid, "BeingKnifed", 0);
SetPVarInt(playerid, "BeingKnifed", 0);
SetPVarInt(targetid, "Knifing", 0);
It could be:

pawn Код:
SetPVarInt(targetid, "KnifeKilled", 0);
SetPVarInt(targetid, "BeingKnifed", 0);
SetPVarInt(targetid, "Knifing", 0);
Reply
#4

The aiming functions are not mine.
Also, i wouldn't ever do this:
pawn Код:
if (IsPlayerAimingAt(playerid, x, y, z-0.75, 0.25)) return true;
    if (IsPlayerAimingAt(playerid, x, y, z-0.25, 0.25)) return true;
    if (IsPlayerAimingAt(playerid, x, y, z+0.25, 0.25)) return true;
    if (IsPlayerAimingAt(playerid, x, y, z+0.75, 0.25)) return true;
    if (IsPlayerAimingAt(playerid, x, y, z+0.75, 0.25)) return true;
    if (IsPlayerAimingAt(playerid, x, y, z+0.75, 0.25)) return true;
    if (IsPlayerAimingAt(playerid, x, y, z+0.75, 0.25)) return true;
    if(IsPlayerAimingBodyPart(playerid, 1) == 1) return true;
    if(IsPlayerAimingBodyPart(playerid, 2) == 1) return true;
    if(IsPlayerAimingBodyPart(playerid, 3) == 1) return true;
Reply
#5

Quote:
Originally Posted by The_Moddler
Посмотреть сообщение
Also, why are you setting a PVar to 0 two times?

pawn Код:
SetPVarInt(targetid, "KnifeKilled", 0);
SetPVarInt(playerid, "KnifeKilled", 0);
SetPVarInt(playerid, "Knifing", 0);
SetPVarInt(targetid, "BeingKnifed", 0);
SetPVarInt(playerid, "BeingKnifed", 0);
SetPVarInt(targetid, "Knifing", 0);
It could be:

pawn Код:
SetPVarInt(targetid, "KnifeKilled", 0);
SetPVarInt(targetid, "BeingKnifed", 0);
SetPVarInt(targetid, "Knifing", 0);
Or even better: DestroyPVar()

Interesting script, might try this out sooner or later
Reply
#6

Quote:
Originally Posted by The_Moddler
Посмотреть сообщение
Also, why are you setting a PVar to 0 two times?

pawn Код:
SetPVarInt(targetid, "KnifeKilled", 0);
SetPVarInt(playerid, "KnifeKilled", 0);
SetPVarInt(playerid, "Knifing", 0);
SetPVarInt(targetid, "BeingKnifed", 0);
SetPVarInt(playerid, "BeingKnifed", 0);
SetPVarInt(targetid, "Knifing", 0);
It could be:

pawn Код:
SetPVarInt(targetid, "KnifeKilled", 0);
SetPVarInt(targetid, "BeingKnifed", 0);
SetPVarInt(targetid, "Knifing", 0);
1 = for targetid and other for playerid..
Reply
#7

oh, hes reseting the pvars for Both players, i see. but why pvars as ****** said

pawn Код:
for(new i, m = GetMaxPlayers(); i < m; i++)
omg ^---------- Lag
Reply
#8

You do understand PVars are slower then regular variables by around 300 MS...? You don't want to use slow functions for something like this... Oh and you may want to think about using foreach.
Reply
#9

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
You do understand PVars are slower then regular variables by around 300 MS...? You don't want to use slow functions for something like this... Oh and you may want to think about using foreach.
Lol.
That is completely untrue.

300ms is a LOT. If any function took 300ms to execute there would be very noticable lag in any server, never mind a variable!
Reply
#10

Quote:
Originally Posted by The_Moddler
Посмотреть сообщение
Also, why are you setting a PVar to 0 two times?

pawn Код:
SetPVarInt(targetid, "KnifeKilled", 0);
SetPVarInt(playerid, "KnifeKilled", 0);
SetPVarInt(playerid, "Knifing", 0);
SetPVarInt(targetid, "BeingKnifed", 0);
SetPVarInt(playerid, "BeingKnifed", 0);
SetPVarInt(targetid, "Knifing", 0);
It could be:

pawn Код:
SetPVarInt(targetid, "KnifeKilled", 0);
SetPVarInt(targetid, "BeingKnifed", 0);
SetPVarInt(targetid, "Knifing", 0);
targetid is not needed if everyone is so goddamn anal about pvar's i don't give a fuk ill update it and not use pvars lmao

Quote:
Originally Posted by wups
Посмотреть сообщение
The aiming functions are not mine.
Also, i wouldn't ever do this:
pawn Код:
if (IsPlayerAimingAt(playerid, x, y, z-0.75, 0.25)) return true;
    if (IsPlayerAimingAt(playerid, x, y, z-0.25, 0.25)) return true;
    if (IsPlayerAimingAt(playerid, x, y, z+0.25, 0.25)) return true;
    if (IsPlayerAimingAt(playerid, x, y, z+0.75, 0.25)) return true;
    if (IsPlayerAimingAt(playerid, x, y, z+0.75, 0.25)) return true;
    if (IsPlayerAimingAt(playerid, x, y, z+0.75, 0.25)) return true;
    if (IsPlayerAimingAt(playerid, x, y, z+0.75, 0.25)) return true;
    if(IsPlayerAimingBodyPart(playerid, 1) == 1) return true;
    if(IsPlayerAimingBodyPart(playerid, 2) == 1) return true;
    if(IsPlayerAimingBodyPart(playerid, 3) == 1) return true;
-snip retarded comment-


updates come i suppose - no pvars since people don't like them
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)