SA-MP Forums Archive
AC timer - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: AC timer (/showthread.php?tid=132756)



AC timer - Naxix - 09.03.2010

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?


Re: AC timer - Zimon95 - 09.03.2010

Код:
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;
}



Re: AC timer - [MWR]Blood - 09.03.2010

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

For the others idk


Re: AC timer - Naxix - 09.03.2010

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!


Re: AC timer - Zimon95 - 09.03.2010

NP