SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 19/04/2019, 04:07 PM   #1
Cordyandrey
Little Clucker
 
Join Date: Mar 2019
Posts: 16
Reputation: 0
Default Kick me my anticheats

I use Nex-AC anti hack for my server.
When I use the /fly or /speed etc command I get kick but I am admin... how to do to use admin commands without receipt kick?
My variabile "PlayerInfo[playerid][pAdmin] == 0
I don't know
Cordyandrey is offline   Reply With Quote
Old 19/04/2019, 04:33 PM   #2
d3Pedro
Huge Clucker
 
Join Date: Apr 2012
Location: darkness
Posts: 321
Reputation: 94
Default Re: Kick me my anticheats

pawn Code:
forward OnCheatDetected(playerid, ip_address[], type, code);
public OnCheatDetected(playerid, ip_address[], type, code)
{
    if(PlayerInfo[playerid][pAdmin] >= 1) return 1;
    //rest of the code
}
d3Pedro is offline   Reply With Quote
Old 19/04/2019, 04:44 PM   #3
Cordyandrey
Little Clucker
 
Join Date: Mar 2019
Posts: 16
Reputation: 0
Default Re: Kick me my anticheats

Where do I put this?
Cordyandrey is offline   Reply With Quote
Old 19/04/2019, 04:48 PM   #4
Cordyandrey
Little Clucker
 
Join Date: Mar 2019
Posts: 16
Reputation: 0
Default Re: Kick me my anticheats

Code:
//Don't make changes in this public
//To customize the punishments, declare 'OnCheatDetected' in your script
ac_fpublic ac_OnCheatDetected(playerid, ip_address[], type, code)
{
	if(type)
	{
		#if defined BlockIpAddress
			BlockIpAddress(ip_address, 0);
		#else
			new ac_strtmp[32];
			format(ac_strtmp, sizeof ac_strtmp, "banip %s", ip_address);
			SendRconCommand(ac_strtmp);
		#endif
	}
	else
	{
		switch(code)
		{
			case 40: SendClientMessage(playerid, AC_DEFAULT_COLOR, MAX_CONNECTS_MSG);
			case 41: SendClientMessage(playerid, AC_DEFAULT_COLOR, UNKNOWN_CLIENT_MSG);
			default:
			{
				static ac_strtmp[sizeof KICK_MSG];
				format(ac_strtmp, sizeof ac_strtmp, KICK_MSG, code);
				SendClientMessage(playerid, AC_DEFAULT_COLOR, ac_strtmp);
				#undef AC_DEFAULT_COLOR
			}
		}
		AntiCheatKickWithDesync(playerid, code);
	}
	return 1;
}

ac_fpublic ac_KickTimer(playerid) return Kick(playerid);

#undef ac_fpublic
Cordyandrey is offline   Reply With Quote
Old 19/04/2019, 04:51 PM   #5
Cordyandrey
Little Clucker
 
Join Date: Mar 2019
Posts: 16
Reputation: 0
Default Re: Kick me my anticheats

Code:
...\pawno\include\nex-ac.inc(8156) : warning 219: local variable "PlayerInfo" shadows a variable at a preceding level
...\pawno\include\nex-ac.inc(8156) : error 017: undefined symbol "pInfo"
...\pawno\include\nex-ac.inc(8156) : error 009: invalid array size (negative, zero or out of bounds)
...\pawno\include\nex-ac.inc(8157) : error 017: undefined symbol "pAdmin"
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.
Code:
ac_fpublic ac_OnCheatDetected(playerid, ip_address[], type, code)
{
    new PlayerInfo[MAX_PLAYERS][pInfo];
    if(PlayerInfo[playerid][pAdmin] >= 1) return 1;
	if(type)
	{
		#if defined BlockIpAddress
			BlockIpAddress(ip_address, 0);
		#else
			new ac_strtmp[32];
			format(ac_strtmp, sizeof ac_strtmp, "banip %s", ip_address);
			SendRconCommand(ac_strtmp);
		#endif
	}
	else
	{
		switch(code)
		{
			case 40: SendClientMessage(playerid, AC_DEFAULT_COLOR, MAX_CONNECTS_MSG);
			case 41: SendClientMessage(playerid, AC_DEFAULT_COLOR, UNKNOWN_CLIENT_MSG);
			default:
			{
				static ac_strtmp[sizeof KICK_MSG];
				format(ac_strtmp, sizeof ac_strtmp, KICK_MSG, code);
				SendClientMessage(playerid, AC_DEFAULT_COLOR, ac_strtmp);
				#undef AC_DEFAULT_COLOR
			}
		}
		AntiCheatKickWithDesync(playerid, code);
	}
	return 1;
}

ac_fpublic ac_KickTimer(playerid) return Kick(playerid);

#undef ac_fpublic
Cordyandrey is offline   Reply With Quote
Old 19/04/2019, 05:05 PM   #6
Cordyandrey
Little Clucker
 
Join Date: Mar 2019
Posts: 16
Reputation: 0
Default Re: Kick me my anticheats

Resolve.
Cordyandrey is offline   Reply With Quote
Old 01/08/2020, 08:05 PM   #7
diliyar413
Little Clucker
 
Join Date: Jul 2011
Posts: 18
Reputation: 0
Default Re: Kick me my anticheats

How to solve it
diliyar413 is offline   Reply With Quote
Old 02/08/2020, 05:48 AM   #8
OsmanMalagic
Little Clucker
 
Join Date: Jul 2016
Location: EX-YU
Posts: 42
Reputation: 54
Default Re: Kick me my anticheats

Quote:
Originally Posted by diliyar413 View Post
How to solve it
PHP Code:
new PlayerInfo[MAX_PLAYERS][pInfo]; // This must be defined on top of script.

ac_fpublic ac_OnCheatDetected(playeridip_address[], typecode)
{
    if(
PlayerInfo[playerid][pAdmin] < 1)
    {
        if(
type)
        {
            
#if defined BlockIpAddress
                
BlockIpAddress(ip_address0);
            
#else
                
new ac_strtmp[32];
                
format(ac_strtmpsizeof ac_strtmp"banip %s"ip_address);
                
SendRconCommand(ac_strtmp);
            
#endif
        
}
        else
        {
            switch(
code)
            {
                case 
40SendClientMessage(playeridAC_DEFAULT_COLORMAX_CONNECTS_MSG);
                case 
41SendClientMessage(playeridAC_DEFAULT_COLORUNKNOWN_CLIENT_MSG);
                default:
                {
                    static 
ac_strtmp[sizeof KICK_MSG];
                    
format(ac_strtmpsizeof ac_strtmpKICK_MSGcode);
                    
SendClientMessage(playeridAC_DEFAULT_COLORac_strtmp);
                    
#undef AC_DEFAULT_COLOR
                
}
            }
            
AntiCheatKickWithDesync(playeridcode);
        }
    }
    return 
1;
}

ac_fpublic ac_KickTimer(playerid) return Kick(playerid);

#undef ac_fpublic 
OsmanMalagic is offline   Reply With Quote
Old 02/08/2020, 12:16 PM   #9
diliyar413
Little Clucker
 
Join Date: Jul 2011
Posts: 18
Reputation: 0
Default Re: Kick me my anticheats

Quote:
Originally Posted by OsmanMalagic View Post
PHP Code:
new PlayerInfo[MAX_PLAYERS][pInfo]; // This must be defined on top of script.

ac_fpublic ac_OnCheatDetected(playeridip_address[], typecode)
{
    if(
PlayerInfo[playerid][pAdmin] < 1)
    {
        if(
type)
        {
            
#if defined BlockIpAddress
                
BlockIpAddress(ip_address0);
            
#else
                
new ac_strtmp[32];
                
format(ac_strtmpsizeof ac_strtmp"banip %s"ip_address);
                
SendRconCommand(ac_strtmp);
            
#endif
        
}
        else
        {
            switch(
code)
            {
                case 
40SendClientMessage(playeridAC_DEFAULT_COLORMAX_CONNECTS_MSG);
                case 
41SendClientMessage(playeridAC_DEFAULT_COLORUNKNOWN_CLIENT_MSG);
                default:
                {
                    static 
ac_strtmp[sizeof KICK_MSG];
                    
format(ac_strtmpsizeof ac_strtmpKICK_MSGcode);
                    
SendClientMessage(playeridAC_DEFAULT_COLORac_strtmp);
                    
#undef AC_DEFAULT_COLOR
                
}
            }
            
AntiCheatKickWithDesync(playeridcode);
        }
    }
    return 
1;
}

ac_fpublic ac_KickTimer(playerid) return Kick(playerid);

#undef ac_fpublic 
Thanks:p
diliyar413 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Ajuda] Comando : /kick | Não aparece ao player o motivo do kick! ScripterInicianteBR Português/Portuguese 3 31/01/2015 08:04 PM
Made /kick Command to Kick Player from Virtual World... MAFIAWARS Scripting Help 11 28/09/2013 03:39 PM
The known kick/ban bug (not sending message with kick/ban) for 0.3x [FIX] zDivine Server Support 4 17/05/2013 09:29 PM


All times are GMT. The time now is 12:40 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.