Anti-Lag Shoot Problem
#5

Not really a good idea Jefff, this is a problem with using OnPlayerGiveDamage() when you actually kill the player OnPlayerDeath() picks it up. What I did and is very effective but takes some more coding in other places is to not even use OnPlayerDeath() but make your own OnPlayerDeath() callback then call it directly when a player is killed. There is another issue all players must be on the same team otherwise you'll take double hits I do have a way around this and implement a mixed-mode where you can skin hit or lead aim but you need to delay each skin hit to make sure OnPlayerTakeDamage() is not called.

@Edit - I think your way could possible work now Jefff but you would need to call OnPlayerDeath() before killing the player and remove SetPlayerHealth() from OnPlayerGiveDamage() then put in these lines in on the top of OnPlayerDeath()


pawn Код:
if(PlayerIsDead[playerid]) return 1;
PlayerIsDead[playerid] = true;
SetPlayerHealth(playerid, 0.0);
That would prevent OnPlayerDeath() from being executed fully until the player is marked alive which would be set in OnPlayerSpawn() although I don't recommend this way using your own callback is the most effective way to deal with fake killing.

Lastly...... make sure you put this in OnPlayerGiveDamage()

pawn Код:
if(IsPlayerStreamedIn(playerid, damagedid) && IsPlayerStreamedIn(damagedid, playerid))
You need to make sure each player is streamed in for the other otherwise someone with packetloss will be able to kill players without that player being even streamed in! We also had another issue with fake OnPlayerGiveDamage() messages being sent although it would still be possible to do this if the other player was streamed in we never had any problems after I made the change.
Reply


Messages In This Thread
Anti-Lag Shoot Problem - by Petry - 29.09.2013, 07:09
Re: Anti-Lag Shoot Problem - by Petry - 30.09.2013, 11:19
Re: Anti-Lag Shoot Problem - by Stereotype - 30.09.2013, 11:31
Re: Anti-Lag Shoot Problem - by Jefff - 30.09.2013, 15:22
Re: Anti-Lag Shoot Problem - by Pottus - 30.09.2013, 16:10
Re: Anti-Lag Shoot Problem - by Jefff - 30.09.2013, 16:17
Re: Anti-Lag Shoot Problem - by Pottus - 30.09.2013, 16:23
Re: Anti-Lag Shoot Problem - by Jefff - 30.09.2013, 16:25
Re: Anti-Lag Shoot Problem - by Pottus - 30.09.2013, 16:26

Forum Jump:


Users browsing this thread: 1 Guest(s)