AC timer
#1

Hi there, i was trying to make a anticheat for health hack, i came up with this:

Top:
Код:
forward HH(playerid);
OnGameModeInnit:
Код:
	SetTimer("HH",5000,1);
Bottom of my script:
Код:
public HH(playerid)
{
	if(GetPlayerHealth(playerid) > 2) //line 374
	{
		SetPlayerHealth(playerid,GetPlayerHealth(playerid) -1); //line 376
		if(GetPlayerHealth(playerid == 100) //line 377
		{ //line 378
		  SendClientMessage(playerid, COLOUR_RED,"Anticheat: You have been banned for Health hacks!");
		  Ban(playerid);
		  return !; //line 381
		}
		SetPlayerHealth(playerid,GetPlayerHealth(playerid) +1); //line 382
		return 1;
	}
	return 1;
}
Errors:
Код:
(374) : warning 202: number of arguments does not match definition
(376) : warning 202: number of arguments does not match definition
(377) : warning 202: number of arguments does not match definition
(378) : error 001: expected token: ")", but found "{"
(381) : error 029: invalid expression, assumed zero
(383) : warning 202: number of arguments does not match definition
Does anyone see the problem?
Reply
#2

Код:
public HH(playerid)
{
    new Float:health;
    GetPlayerHealth(playerid,health);
	if(health > 2) //line 374
	{
		SetPlayerHealth(playerid, health-1); //line 376
		if(health == 100) //line 377
		{ //line 378
		  SendClientMessage(playerid, COLOUR_RED,"Anticheat: You have been banned for Health hacks!");
		  Ban(playerid);
		  return 1; //line 381
		}
		SetPlayerHealth(playerid,health+1); //line 382
		return 1;
	}
	return 1;
}
Reply
#3

Line 381: return !; Does not exist.Maybe you mean return 1;
Line 377: if(GetPlayerHealth(playerid == 100))

For the others idk
Reply
#4

Quote:
Originally Posted by Zimon95
Код:
public HH(playerid)
{
    new Float:health;
    GetPlayerHealth(playerid,health);
	if(health > 2) //line 374
	{
		SetPlayerHealth(playerid, health-1); //line 376
		if(health == 100) //line 377
		{ //line 378
		  SendClientMessage(playerid, COLOUR_RED,"Anticheat: You have been banned for Health hacks!");
		  Ban(playerid);
		  return 1; //line 381
		}
		SetPlayerHealth(playerid,health+1); //line 382
		return 1;
	}
	return 1;
}
Thank you!
Reply
#5

NP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)