SA-MP Forums Archive
help with a bug (fight style) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help with a bug (fight style) (/showthread.php?tid=648224)



help with a bug (fight style) - None1337 - 17.01.2018

Hello, i have an anticheat system for damage fake on my server (in OnPlayerGiveDamage).

But when a player have FIGHT_STYLE_KNEEHEAD sometimes get kicked when he give a loot of dmg. Bdw, i have this condition (amount != 54.12), but the damage is 54.12 and he still get kicked.
https://i.imgur.com/DjZE7Zf.png

How can i fix?

take a look here: https://pastebin.com/iXWZxyug

max dmg for fist I have 10.0 + 2.5 in OnPlayerGiveDamage


Re: help with a bug (fight style) - Dayrion - 17.01.2018

Quote:
Originally Posted by None1337
Посмотреть сообщение
Hello, i have an anticheat system for damage fake on my server (in OnPlayerGiveDamage).

But when a player have FIGHT_STYLE_KNEEHEAD sometimes get kicked when he give a loot of dmg. Bdw, i have this condition (amount != 54.12), but the damage is 54.12 and he still get kicked.
https://i.imgur.com/DjZE7Zf.png

How can i fix?

take a look here: https://pastebin.com/iXWZxyug

max dmg for fist I have 10.0 + 2.5 in OnPlayerGiveDamage
Seems the damage is not exactly 54.12. Be less precise in your condition (± 1.0).


Re: help with a bug (fight style) - None1337 - 17.01.2018

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
Seems the damage is not exactly 54.12. Be less precise in your condition (± 1.0).
i don t understand, should I add more +1.0 or less?


Re: help with a bug (fight style) - Dayrion - 17.01.2018

Quote:
Originally Posted by None1337
Посмотреть сообщение
i don t understand, should I add more +1.0 or less?
Something like..
PHP код:
if(amount weapon_max_damage[weaponid]+2.5 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) {
                if(
weaponid == && !(55.12 <= amount <= 53.12)) {
                    
SCMF(playerid, -1"You were kicked for dmg cheats (%.2f) with %s."amountwname);
                    
KickEx(playerid);
                    return 
0;
                }
            } 



Re: help with a bug (fight style) - None1337 - 17.01.2018

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
Something like..
PHP код:
if(amount weapon_max_damage[weaponid]+2.5 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) {
                if(
weaponid == && !(55.12 <= amount <= 53.12)) {
                    
SCMF(playerid, -1"You were kicked for dmg cheats (%.2f) with %s."amountwname);
                    
KickEx(playerid);
                    return 
0;
                }
            } 
I still get kick.


Re: help with a bug (fight style) - Dayrion - 17.01.2018

Quote:
Originally Posted by None1337
Посмотреть сообщение
I still get kick.
Well, print the weaponid in your message instead of his name.


Re: help with a bug (fight style) - Dayrion - 17.01.2018

My bad, sorry. Try this:
PHP код:
if(amount weapon_max_damage[weaponid]+2.5 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) {
                if(
weaponid == && !(55.12 >= amount >= 53.12)) {
                    
SCMF(playerid, -1"You were kicked for dmg cheats (%.2f) with %s."amountwname);
                    
KickEx(playerid);
                    return 
0;
                }
            } 



Re: help with a bug (fight style) - None1337 - 18.01.2018

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
My bad, sorry. Try this:
PHP код:
if(amount weapon_max_damage[weaponid]+2.5 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) {
                if(
weaponid == && !(55.12 >= amount >= 53.12)) {
                    
SCMF(playerid, -1"You were kicked for dmg cheats (%.2f) with %s."amountwname);
                    
KickEx(playerid);
                    return 
0;
                }
            } 
I still get kicked...


Re: help with a bug (fight style) - None1337 - 27.01.2018

bump