help me plz
#1

i have this code for anti health hack but when i type /hackers it says None while my health is 100.

Код:
stock CheckAntiHealth(playerid){
    if((AntiHealthHackCD[playerid]+3)<gettime()){
	    new Float:hp;GetPlayerHealth(playerid,hp);
	    if(hp==100&&IsPlayerInASK[playerid]==false&&AdminDuty[playerid]==false){
			IsPlayerHacker[playerid]=true;
			AntiHealthHackCD[playerid]=gettime();}
		else IsPlayerHacker[playerid]=false;}
	return 1;}
Код:
CMD:hackers(playerid,params[]){
	#pragma unused params
	if(!CheckCmdStatus("hackers"))return SendClientMessage(playerid,COLOR_RED,"This command is disabled.");
	if(!CheckAdminPerm(playerid,1))return SendClientMessage(playerid,COLOR_RED,"You are not authorized to use this command.");
	new count=0;
	SendClientMessage(playerid,COLOR_BLUE,"Hackers List:");
	foreach(Player,i){
		if(IsPlayerHacker[i]==true){
		    new Float:hp;GetPlayerHealth(i,hp);
		    new Float:ar;GetPlayerArmour(i,ar);
			SendClientMessageEx(playerid,COLOR_WHITE," %s(%d) - Health:%.1f - Armour:%.1f",PlayerName(i),i,hp,ar);
			count++;}}
	if(count==0)SendClientMessage(playerid,COLOR_WHITE," None.");
	return 1;}
Reply
#2

1) Wohkay, I fucked up!
2) You can simply skip using params[] instead of #pragma unused params
3) OnPlayerUpdate is too much for this, I'd suggest you use a timer!

There are some other things you need to clean up too, such as declaring vars within a loop, etc, but take a look at these two.
Reply
#3

CheckAntiHealth(playerid) is in onplayerupdate
Reply
#4

not work!
Reply
#5

Well I'll advice you update your anti healh hack wih
under
OnPlayerSpawn
SetPlayerHealth(playerid,9;

try to check it Under OnPlayerWeaponShot

Try to check health of hitid if his health is 100 if he is spawned and not freezed
if his health is 100 then report it to admin that he is hacker or bugged.

I hope it will help you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)