[0.3b, 0.3c]Auto Re-sync on knife De-sync -
Whitetiger - 16.12.2010
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
Re: [0.3b, 0.3c]Auto Re-sync on knife De-sync -
Ash. - 16.12.2010
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!
Re: [0.3b, 0.3c]Auto Re-sync on knife De-sync -
The_Moddler - 16.12.2010
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);
Re: [0.3b, 0.3c]Auto Re-sync on knife De-sync -
wups - 16.12.2010
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;
Re: [0.3b, 0.3c]Auto Re-sync on knife De-sync -
Hiddos - 16.12.2010
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
Re: [0.3b, 0.3c]Auto Re-sync on knife De-sync -
Mokerr - 16.12.2010
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..
Re: [0.3b, 0.3c]Auto Re-sync on knife De-sync -
The_Gangstas - 16.12.2010
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
Re: [0.3b, 0.3c]Auto Re-sync on knife De-sync -
Scenario - 16.12.2010
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.
Re: [0.3b, 0.3c]Auto Re-sync on knife De-sync -
Jay_ - 16.12.2010
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!
Re: [0.3b, 0.3c]Auto Re-sync on knife De-sync -
Whitetiger - 16.12.2010
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