SA-MP Forums Archive
anti fly help - 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: anti fly help (/showthread.php?tid=465213)



anti fly help - Chiao - 21.09.2013

Hello dear people I need some help and I was thinking if any of you would help me out a little I'm trying to make a little anti-cheat that bans the player using a "cheat" I only need some help with this piece of the script:
Код:
SendClientMessage(playerid,0xC30000FF,"You are banned Reason: Flyhack");
	Ban();
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
Im getting the following error warning 202: number of arguments does not match definition its on line 71 which is the Ban(); code will anyone help me out?


Re: anti fly help - Konstantinos - 21.09.2013

Ban function needs a playerid as a parameter.
pawn Код:
Ban(playerid);



Re: anti fly help - Chiao - 21.09.2013

The script was pre-set on kicking mode and now I wanted to convert it into banning so if I put Ban(playerid); then it will just simply kick


Re: anti fly help - Chiao - 21.09.2013

Any help?


Re: anti fly help - DanishHaq - 21.09.2013

Can you give us the whole callback for that? Or at least the whole thing regarding the flyhack, i.e. how it's being detected, so we can see if it's kicking or banning the player somewhere else maybe.


Re: anti fly help - Konstantinos - 21.09.2013

Ban functions bans the player, it does not kick them. Kick is used for that.


Re: anti fly help - Chiao - 21.09.2013

Код:
#define FILTERSCRIPT

#include <a_samp>

new timer[MAX_PLAYERS];
new savetp[MAX_PLAYERS];
new dives[MAX_PLAYERS];

/*
native SetPlayerPosition(pid,Float:X,Float:Y,Float:Z);
*/

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print(" Antifly");
	return 1;
}
#else

main()
{
}

#endif
public OnPlayerConnect(playerid)
{
	dives[playerid] = 0;
	return 1;
}
public OnPlayerUpdate(playerid)
{
    if(GetPlayerAnimationIndex(playerid))
	{
	new animlib[32];
	new animname[32];
	GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
	if(strcmp(animlib, "SWIM", true) == 0)
	{
	new Float:X,Float:Y,Float:Z;
	GetPlayerPos(playerid,X,Y,Z);
	if(Z >= 8.45)
	{
	if(!IsPlayerInRangeOfPoint(playerid,37.85,1964.0404,-1199.6774,17.4400))
	{
	dives[playerid] = 1;
	}
	}
	}
	GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
	if(strcmp(animname, "FALL_FALL", true) == 0)
	{
	new Float:X,Float:Y,Float:Z;
	GetPlayerPos(playerid,X,Y,Z);
	SetPVarFloat(playerid,"Float",Z);
	SetTimer("Checkhim",1200,false);
	}
	}
    new index = GetPlayerAnimationIndex(playerid);
	if(index >= 958 && index <= 962)
    {
    if(GetPlayerWeapon(playerid) != 46)
    {
	dives[playerid] = 1;
    }
    }
    if(dives[playerid] == 1)
	{
	SendClientMessage(playerid,0xC30000FF,"You are banned Reason: Flyhack");
	Ban(playerid);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerAdmin(i))
    {
    new string[100];
    new name[100];
    format(string,sizeof(string),"%s has been banned Reason: Flyhack",GetPlayerName(playerid,name,sizeof(name)));
    SendClientMessage(i,0xC30000FF,string);
    }
    }
	}
	return 1;
}
stock SetPlayerPosition(pid,Float:X,Float:Y,Float:Z)
{
	savetp[pid] = 1;
	SetPlayerPos(pid,X,Y,Z);
	KillTimer(timer[pid]);
	timer[pid] = SetTimer("remtp",15000,false);
}
forward remtp(playerid);
public remtp(playerid)
{
	savetp[playerid] = 0;
	return 1;
}
forward Checkhim(playerid);
public Checkhim(playerid)
{
	new Float:X,Float:Y,Float:Z;
	GetPlayerPos(playerid,X,Y,Z);
	if(Z > GetPVarFloat(playerid,"Float"))
	{
	if(savetp[playerid] != 1)
	{
	dives[playerid] = 1;
	}
	}
	return 1;
}



Re: anti fly help - Chiao - 21.09.2013

Will anyone help me?


Re: anti fly help - Chiao - 21.09.2013

Can I get some help please?