SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 25/04/2017, 09:50 AM   #1
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Ottawa, Canada
Posts: 1,691
Reputation: 671
Default lagcomp.inc - Fixed lagcomp response; custom weapon damage; serversided damage handling

Lagcomp.inc
Version: 2.0 | Last Updated: 5 Sept, 2017


Lagcomp is a simple include which fixes SAMP lagcomp response and detection vastly. There are some advantages too such as protection against Fake kills and since the damage system is all server sided, there is no way hackers can hack Weapon damage values.

Since the damage system is server sided, you can set the weapon's damage per player:
(Note: the damage value is only override for Player giving Player damage, for self damage, these functions don't work)
PHP Code:
SetPlayerWeaponDamage(playeridweaponidFloat:damage);
Float:GetPlayerWeaponDamage(playeridweaponid); 
Installation
  • Click on the download link given above.
  • Click "Raw" button on top of script and "Copy" the code from there.
  • Go to your pawno/include folder and make a new text document file.
  • Paste all the code there and save it as "lagcomp.inc".
  • Goto your script and add "#include <lagcomp>" right after "#include <a_samp>". Then you can include other libraries but this one should be above them.

Download
https://github.com/Agneese-Saini/SA-...de/lagcomp.inc

Credits
Slice - "ProcessDamage" function with the damage data array
Humza - Testing the script
__________________

Last edited by Gammix; 11/09/2017 at 04:36 PM.
Gammix is offline   Reply With Quote
Old 25/04/2017, 09:51 AM   #2
Max_Andolini
Huge Clucker
 
Max_Andolini's Avatar
 
Join Date: Oct 2013
Posts: 294
Reputation: 34
Default Re: lagcomp.inc - Fixed lagcomp response; custom weapon damage; serversided damage handling

Good job!
Max_Andolini is offline   Reply With Quote
Old 25/04/2017, 09:58 AM   #3
Logic_
High-roller
 
Logic_'s Avatar
 
Join Date: Jun 2015
Location: Next to Oblivion (Kalcor's place)
Posts: 1,184
Reputation: 180
Default Re: lagcomp.inc - Fixed lagcomp response

Wasn't this was going to be in the server-sided include which you removed lately?
__________________
Providing SA-MP, G-MOD, Minecraft, MTA and Web hosting @ https://www.prestigesteve.com.
Top notch quality experience and support!
Logic_ is offline   Reply With Quote
Old 25/04/2017, 10:00 AM   #4
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Ottawa, Canada
Posts: 1,691
Reputation: 671
Default Re: lagcomp.inc - Fixed lagcomp response

Quote:
Originally Posted by Logic_ View Post
Wasn't this was going to be in the server-sided include which you removed lately?
serversided wasn't gonna make it since you required SKY plugin and everything slice did in weapon-config. So that's why there was no point in making a copy.

This only fixes your lagcomp. This can be further developed for an anti cheat. I guess i will make anti health and armor from this.
__________________
Gammix is offline   Reply With Quote
Old 25/04/2017, 10:08 AM   #5
Killa[DGZ]
Huge Clucker
 
Killa[DGZ]'s Avatar
 
Join Date: Feb 2010
Location: Australia
Posts: 374
Reputation: 69
Default Re: lagcomp.inc - Fixed lagcomp response

Good release Gammix!,

But isn't this completely useless?, as 'OnPlayerGiveDamage' and 'OnPlayerTakeDamage' can both be faked by some fake kill cheats?


EDIT: Ahh I see, damage checks.. thats very clever indeed
__________________
Killa[DGZ] is offline   Reply With Quote
Old 25/04/2017, 10:26 AM   #6
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Ottawa, Canada
Posts: 1,691
Reputation: 671
Default Re: lagcomp.inc - Fixed lagcomp response

Quote:
Originally Posted by Killa[DGZ] View Post
Good release Gammix!,

But isn't this completely useless?, as 'OnPlayerGiveDamage' and 'OnPlayerTakeDamage' can both be faked by some fake kill cheats?


EDIT: Ahh I see, damage checks.. thats very clever indeed
I forgot to mention this also has protection against fake kills
__________________
Gammix is offline   Reply With Quote
Old 25/04/2017, 11:16 AM   #7
Killa[DGZ]
Huge Clucker
 
Killa[DGZ]'s Avatar
 
Join Date: Feb 2010
Location: Australia
Posts: 374
Reputation: 69
Default Re: lagcomp.inc - Fixed lagcomp response

Quote:
Originally Posted by Gammix View Post
I forgot to mention this also has protection against fake kills
Small issue?,

line 488 : warning 202: number of arguments does not match definition
PHP Code:
return LC_OnPlayerTakeDamage(playeridissueridamountweaponidbodypart); 
line 500 : error 025: function heading differs from prototype
PHP Code:
forward LC_OnPlayerTakeDamage(playeridissueridFloat:amountweaponidbodypart); 
line 550 : warning 202: number of arguments does not match definition
PHP Code:
LC_OnPlayerTakeDamage(damagedidplayeridamountweaponidbodypart); 
I'm already using the native within my gamemode.. could that be it?
__________________
Killa[DGZ] is offline   Reply With Quote
Old 25/04/2017, 11:44 AM   #8
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Ottawa, Canada
Posts: 1,691
Reputation: 671
Default Re: lagcomp.inc - Fixed lagcomp response

Quote:
Originally Posted by Killa[DGZ] View Post
Small issue?,

line 488 : warning 202: number of arguments does not match definition
PHP Code:
return LC_OnPlayerTakeDamage(playeridissueridamountweaponidbodypart); 
line 500 : error 025: function heading differs from prototype
PHP Code:
forward LC_OnPlayerTakeDamage(playeridissueridFloat:amountweaponidbodypart); 
line 550 : warning 202: number of arguments does not match definition
PHP Code:
LC_OnPlayerTakeDamage(damagedidplayeridamountweaponidbodypart); 
I'm already using the native within my gamemode.. could that be it?
One of your include is using a different set of parameters for OnPlayerTakeDamage.
__________________
Gammix is offline   Reply With Quote
Old 25/04/2017, 02:41 PM   #9
Killa[DGZ]
Huge Clucker
 
Killa[DGZ]'s Avatar
 
Join Date: Feb 2010
Location: Australia
Posts: 374
Reputation: 69
Default Re: lagcomp.inc - Fixed lagcomp response

You were right, I was simply missing the 'bodypart' parameter from the function heading within my gamemode..
PHP Code:
OnPlayerTakeDamage(playeridissueridFloat:amountweaponid
Thanks.
__________________
Killa[DGZ] is offline   Reply With Quote
Old 26/04/2017, 02:55 AM   #10
Killa[DGZ]
Huge Clucker
 
Killa[DGZ]'s Avatar
 
Join Date: Feb 2010
Location: Australia
Posts: 374
Reputation: 69
Default Re: lagcomp.inc - Fixed lagcomp response

A few small issues with this, tested with 10 players within a deathmatch.

You get full armour everytime you kill somebody?(confirmed multiple times)
Sometimes when shooting someone you lose health instead of the target?(confirmed multiple times)
__________________
Killa[DGZ] is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Pedido] lagcomp JoshNudock Português/Portuguese 8 14/06/2016 07:09 PM
Destroy lagcomp please. TDMY0HoWnEr General 15 10/08/2014 08:58 AM
[FilterScript] Easy custom damage + damage sound Voxel Filterscripts 14 30/09/2013 05:07 PM
Custom weapon damage problems with kill-logs? Mado Scripting Help 3 08/01/2013 10:15 AM


All times are GMT. The time now is 12:29 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.