tenta usar o meu ele fuinciona no meu host
pawn Код:
#include <a_samp>
#define _CHANGE_NAME_BEFORE_KICK true
stock
bool: bIllegalPlayer [ MAX_PLAYERS ] = false,
szTmpKickName [ MAX_PLAYER_NAME ];
public OnFilterScriptInit( )
{
print( "* Nome proibido!" );
print( "* os seguintes nomes estгo proibidos para entrar no server:" );
print( "\tcom[1-9], lpt[1-9], clock$, nul, aux, prn, con" );
#if _CHANGE_NAME_BEFORE_KICK == true
for ( new i = 0; i < MAX_PLAYER_NAME; i++ )
szTmpKickName[ i ] = '_';
szTmpKickName[ MAX_PLAYER_NAME - 1 ] = '\0';
print( "* O nick esta sendo temporarimente usado para kickar crashers:" );
printf( "\t%s", szTmpKickName );
#endif
return 1;
}
public OnPlayerConnect( playerid )
{
new
szPlayerName[ MAX_PLAYER_NAME ];
bIllegalPlayer[ playerid ] = false;
GetPlayerName( playerid, szPlayerName, MAX_PLAYER_NAME );
if ( !strcmp( szPlayerName, "com", true, 3 ) || !strcmp( szPlayerName, "lpt", true, 3 ) )
{
if ( szPlayerName[ 3 ] >= '0' && szPlayerName[ 3 ] <= '9' && szPlayerName[ 4 ] == '\0' )
return aKick( playerid, szPlayerName );
}
else if ( !strcmp( szPlayerName, "clock$", true, 6 ) )
return aKick( playerid, szPlayerName );
else
{
static const
szForbiddenName[ ][ ] =
{
"nul", "aux",
"prn", "con"
};
for ( new i = 0; i < sizeof( szForbiddenName ); i++ )
{
if ( !strcmp( szPlayerName, szForbiddenName[ i ], true, 3 ) )
return aKick( playerid, szPlayerName );
}
#if _CHANGE_NAME_BEFORE_KICK == true
// Players cannot join with our temporary kicking name either...
// this name is "________________" by default which you probably don't want anyways.
if ( !strcmp( szPlayerName, szTmpKickName, true, MAX_PLAYER_NAME ) )
return aKick( playerid, szPlayerName );
#endif
}
return 1;
}
public OnPlayerDisconnect( playerid, reason )
{
if ( bIllegalPlayer[ playerid ] )
{
bIllegalPlayer[ playerid ] = false;
return 0;
}
return 1;
}
stock aKick( playerid, pname[ ] )
{
new
szIP[ 16 ];
bIllegalPlayer[ playerid ] = true;
#if _CHANGE_NAME_BEFORE_KICK
SetPlayerName( playerid, szTmpKickName );
#endif
GetPlayerIp( playerid, szIP, 16 );
SendClientMessage( playerid, 0xFFFFFFFF, "SERVER: vc foi estrupado por THE fdmae" );
Kick( playerid );
printf( "[protetor] %s (%d:%s) chupa o THE.", pname, playerid, szIP );
return 0;
}