[Include] lagcomp.inc - Fixed lagcomp response; custom weapon damage; serversided damage handling
#21

Quote:
Originally Posted by Yashas
View Post
Where did you test?
It was tested live on DriftGodZ, with 10 players, playing M4DM as that was where we have the most issues of some players not taking damage correctly (appear to be bulletproof sometimes, but still bleed when shot).

A number of players reported an improvement with shot damage saying it was much faster than before.. and seemed like all shots fired were being accounted for.

But now I think about what you said a little.. my problem could've just be the same as your problem yashas with some people becoming somewhat bulletproof during combat an don't appear to take any damage?

The flaw is that fake killers can send information to OnPlayerGive/TakeDamage, which is now synced with this include.

For example I have always marked the victim in the OnPlayerGive/TakeDamage callbacks with the issuer ID+total damage dealt for OnPlayerDeath fake kill checks.. an hackers can still fake that, an have a little laugh about it to my admins.
Reply
#22

Update 26 April, 2017
- Fixed damage giving to issuer instead of player.
- Fixed anti-fake kill.


@Yashas: Here, test this script with a friend (once with lagcomp included and one without) and you'll see the difference)
What we basically tested is running around and meleeing. Secondly one player run sprint around and one shoots with M4. See the some bullets not being registered or the bell sound would not ring.
PHP Code:
main()
{
}

public 
OnPlayerRequestClass(playeridclassid)
{
    return 
SetTimerEx("OnPlayerEnterClassSelection"150false"i"playerid);
}

forward OnPlayerEnterClassSelection(playerid);
public 
OnPlayerEnterClassSelection(playerid)
{
    return 
SpawnPlayer(playerid);
}

public 
OnPlayerTakeDamage(playeridissueridFloat:amountweaponidbodypart)
{
    
PlayerPlaySound(issuerid64010.00.00.0);
    return 
1;
}

public 
OnPlayerSpawn(playerid)
{
    
SetPlayerPos(playerid1642.1957, -2334.484913.5469);
    
GivePlayerWeapon(playerid31100);
    
GivePlayerWeapon(playerid165);
    
GivePlayerWeapon(playerid31);
    return 
1;

Reply
#23

Really nicely done. Thanks Gammix for such a awesome fix.
Reply
#24

Player's must hate my server shooting then?

I handle my damage in OnPlayerTakeDamage because of all the trust issues on OnPlayerGiveDamage, so you're saying this fixes those 'trust' issues?
Reply
#25

Quote:
Originally Posted by Kar
View Post
Player's must hate my server shooting then?

I handle my damage in OnPlayerTakeDamage because of all the trust issues on OnPlayerGiveDamage, so you're saying this fixes those 'trust' issues?
Well wiki says OnPlayerGiveDamage can send inaccurate data but since i am doing most checks i guess its working pretty fin for now. I don't know what inaccurate data could it send?
Reply
#26

What about knife? and all types of explosions?
Reply
#27

Quote:
Originally Posted by Jefff
View Post
What about knife? and all types of explosions?
Yes, everything is covered. Because whenever you give damage anyways, OnPlayerGiveDamage is called.
Reply
#28

Quote:
Originally Posted by Gammix
View Post
Yes, everything is covered. Because whenever you give damage anyways, OnPlayerGiveDamage is called.
The only advantage of this I can see from the raw code is, faster damage updating and having checking for exact values when damage is done, that is good so hackers can't sproof ridiculous damage values.

But what happens if a client proofs OnPlayerGiveDamage with those exact damage values?

Also, why use this over weapon-config?
Reply
#29

Quote:
Originally Posted by Kar
View Post
But what happens if a client proofs OnPlayerGiveDamage with those exact damage values?
What do you mean?

Quote:
Originally Posted by Kar
View Post
Also, why use this over weapon-config?
No, i just don't want to have custom heath progressbar so i made this. Ofcourse weapon-config is superior than this and uses the same logic here for giving damage.
Reply
#30

Update Removed.
Reply
#31

I was always interested in what lagcomp.inc was going to become, & now its integrated with a fully functional (& accurate) anticheat! Great work as always!

I suggest you make the casino/sprunk etc scripts in seperate .inc's that can be optionally attached. I love how simple this anticheat is, & it'd be a shame if it turned into the clusterfuck that Nex-AC has become (not necessarily a bad thing, just not my preference to have 10000 lines of code of #if defines when all I need is 1000 of them).
Reply
#32

Quote:
Originally Posted by Chaprnks
View Post
I was always interested in what lagcomp.inc was going to become, & now its integrated with a fully functional (& accurate) anticheat! Great work as always!

I suggest you make the casino/sprunk etc scripts in seperate .inc's that can be optionally attached. I love how simple this anticheat is, & it'd be a shame if it turned into the clusterfuck that Nex-AC has become (not necessarily a bad thing, just not my preference to have 10000 lines of code of #if defines when all I need is 1000 of them).
I'll make a separate include for anticheat. I have decided this to stay as a lagcomp only fix include.
Reply
#33

Quote:
Originally Posted by Gammix
View Post
I'll make a separate include for anticheat. I have decided this to stay as a lagcomp only fix include.
That's a good move lad.

Please have a look in this backtrace. i am printing every command i use.
PHP Code:
[14:51:26] [Commandgurmani11(0): /kill
[14:51:27] [debugRun time error 4"Array index out of bounds"
[14:51:27] [debug]  Attempted to read/write array element at index 65535 in array of size 1000
[14:51:27] [debugAMX backtrace:
[
14:51:27] [debug#0 0000bea8 in AC_ProcessDamage (&playerid=@0028c244 0, &issuerid=@0028c248 65535, &Float:amount=@0028c24c 2.64000, &weaponid=@0028c250 0, &bodypart=@0028c254 3) at H:\MyScripts\pawno\include\GAC.inc:566
[14:51:27] [debug#1 0000f708 in public OnPlayerTakeDamage (playerid=0, issuerid=65535, Float:amount=2.64000, weaponid=0, bodypart=3) at H:\MyScripts\pawno\include\GAC.inc:989 
Well this addition has fixed it, anyway heads up! because INAVLID_PLAYER_ID has bypassed from initial check In OnPlayerTakeDamage.
PHP Code:
    if (issuerid != INVALID_PLAYER_ID && !AC_ProcessDamage(playeridissueridamountweaponidbodypart))
        return 
1
Reply
#34

I do, yeah but why would it trigger the include?
Reply
#35

Quote:
Originally Posted by Dokins
View Post
I do, yeah but why would it trigger the include?
It's likely that you're not checking if issuerid is valid before using it, the error doesn't seem to be from the include.
Reply
#36

Quote:
Originally Posted by Abagail
View Post
It's likely that you're not checking if issuerid is valid before using it, the error doesn't seem to be from the include.
It doesn't matter, this includes checks for that but this part doesn't.
Reply
#37

So what part is the issue exactly?
Reply
#38

Quote:
Originally Posted by Dokins
View Post
So what part is the issue exactly?
I have an updated version of this include i haven't launched yet. Basically it only uses LC_ProcessDamage in OnPlayerGieDamage. Which will resolve the issue.

I'll be putting up the update soon today.
Reply
#39

Perfect, thanks very much.
Reply
#40

What about this part
Code:
SetPlayerHealth(damagedid, (health - armour));
if armour is lower than 0.0, (health - (-40.0)) = ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)