Help ant cheat - 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 ant cheat (
/showthread.php?tid=590494)
Help ant cheat -
Holl - 30.09.2015
Help please , Code:
Pastebin
Problem: I have a problem when you give a gun ID 10 to the player he is kicked .. Because of the ant cheat
Re: Help ant cheat -
PrO.GameR - 30.09.2015
I guess this probably happens to all weapons with no ammo ? if yes it has something to do with this line
PHP код:
if(tmp[2] < tmp[4]) { RemoveWeapon(i, tmp[3]); ACKick(i,"Hack Armas"); }
This might fix it, as I have no idea how melee weapon ammos are saved
PHP код:
if(tmp[2] < tmp[4]&&tmp[0]!=10) { RemoveWeapon(i, tmp[3]); ACKick(i,"Hack Armas"); }
if this didn't fix it add this line after your getplayerweapondata and show us what it prints on your console
PHP код:
printf("SLOT:%i WeapData:%i pWeapData:%i WeapAData:%i pWeapAData:%i",tmp[0],tmp[1],tmp[3],tmp[2],tmp[4]);
Re: Help ant cheat -
Holl - 30.09.2015
Quote:
Originally Posted by PrO.GameR
I guess this probably happens to all weapons with no ammo ? if yes it has something to do with this line
PHP код:
if(tmp[2] < tmp[4]) { RemoveWeapon(i, tmp[3]); ACKick(i,"Hack Armas"); }
This might fix it, as I have no idea how melee weapon ammos are saved
PHP код:
if(tmp[2] < tmp[4]&&tmp[0]!=10) { RemoveWeapon(i, tmp[3]); ACKick(i,"Hack Armas"); }
if this didn't fix it add this line after your getplayerweapondata and show us what it prints on your console
PHP код:
printf("SLOT:%i WeapData:%i pWeapData:%i WeapAData:%i pWeapAData:%i",tmp[0],tmp[1],tmp[3],tmp[2],tmp[4]);
|
PHP код:
[09:24:55] SLOT:1 WeapData:8 pWeapData:8 WeapAData:1 pWeapAData:1
[09:24:57] SLOT:1 WeapData:8 pWeapData:8 WeapAData:1 pWeapAData:1
[09:24:58] SLOT:1 WeapData:8 pWeapData:8 WeapAData:1 pWeapAData:1
[09:24:59] SLOT:1 WeapData:8 pWeapData:8 WeapAData:1 pWeapAData:1
[09:25:01] SLOT:1 WeapData:8 pWeapData:8 WeapAData:1 pWeapAData:1
[09:25:05] SLOT:1 WeapData:8 pWeapData:8 WeapAData:1 pWeapAData:1
[09:25:06] SLOT:1 WeapData:8 pWeapData:8 WeapAData:1 pWeapAData:1
[09:25:07] SLOT:11 WeapData:10 pWeapData:0 WeapAData:1 pWeapAData:0
[09:25:09] Mynick has left the server (kick ant cheat)
Re: Help ant cheat -
PrO.GameR - 30.09.2015
Oh I found the reason that is happening, you are checking if he have the weap according to your variables, then checking if he doesn't have them, what you should check is what he has, and if he doesn't have it in his variables to kick him.
PHP код:
if(tmp[3] != tmp[1]) { RemoveWeapon(i, tmp[3]); ACKick(i,"Hack Armas"); }
if(tmp[4] > tmp[2]) { RemoveWeapon(i, tmp[3]); ACKick(i,"Hack Armas"); }
Код:
[09:25:07] SLOT:11 WeapData:10 pWeapData:0 WeapAData:1 pWeapAData:0
This means he has weapon id 10 with 1 ammo, but doesn't have it scriptwisely