Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //==============================================================================
- #include <a_samp>
- //==============================================================================
- // Red
- #define COLOR_DARKRED 0x660000AA
- #define COLOR_LIGHTRED 0xFF99AADD
- // Blue
- #define COLOR_SWAT_BLUE 0x0000FFAA
- #define COLOR_NEUTRALBLUE 0xABCDEF01
- #define COLOR_LIGHTBLUE 0x33CCFFAA
- #define COLOR_BLUE 0x0000BBAA
- #define COLOR_VIOLET 0x9955DEEE
- #define COLOR_LIGHTCYAN 0xAAFFCC33
- // Green
- #define COLOR_LIGHTGREEN 0x24FF0AB9
- #define COLOR_SEAGREEN 0x00EEADDF
- #define COLOR_GREEN 0x33AA33AA
- // Other
- #define COLOR_PINK 0xFF66FFAA
- #define COLOR_PURPLE 0x800080AA
- #define COLOR_NEUTRAL 0xABCDEF97
- #define COLOR_GLOBAL 0xD0D0FFAA
- // Rainbow
- #define COLOR_RED 0xFF0000AA
- #define COLOR_ORANGE 0xFF9900AA
- #define COLOR_YELLOW 0xFFFF00AA
- #define COLOR_GREEN 0x33AA33AA
- #define COLOR_BLUE 0x0000BBAA
- #define COLOR_VIOLET 0x9955DEEE
- // Black - White
- #define COLOR_WHITE 0xFFFFFF00
- #define COLOR_GREY 0xAFAFAFAA
- #define COLOR_BLACK 0x000000AA
- //==============================================================================
- new Text: BanMessage;
- //==============================================================================
- forward BannedWeaponCheck ( );
- //==============================================================================
- new BannedWeapons [ 999 ];
- new MAX_BANNED_WEAPONS = 0;
- new Spawned [ MAX_PLAYERS ];
- //==============================================================================
- public OnFilterScriptInit ( )
- {
- //BanWeapon ( 38 ); // An example of how to ban a weapon, in this case: weapon id 38 (minigun)
- SetTimer ( "BannedWeaponCheck" , 1000 , true );
- BanMessage = TextDrawCreate ( 150 , 200 , "~r~You have been Banned from the server!~n~~w~Please disconnect" );
- TextDrawLetterSize ( BanMessage , 0.5 , 1.8 );
- TextDrawBoxColor ( BanMessage , COLOR_BLACK );
- TextDrawBackgroundColor ( BanMessage , COLOR_BLACK );
- TextDrawUseBox ( BanMessage , 1 );
- TextDrawFont ( BanMessage , 3 );
- TextDrawSetOutline ( BanMessage , 1 );
- return 1;
- }
- //==============================================================================
- public BannedWeaponCheck ( )
- {
- for ( new playerid = 0; playerid < MAX_PLAYERS; playerid ++ )
- {
- for ( new weaponid = 0; weaponid < MAX_BANNED_WEAPONS; weaponid ++ )
- {
- if ( GetPlayerWeapon ( playerid ) == BannedWeapons [ weaponid ] && Spawned [ playerid ] == 1 )
- {
- Ban ( playerid );
- }
- }
- }
- }
- //==============================================================================
- public OnPlayerDisconnect ( playerid , reason )
- {
- Spawned [ playerid ] = 0;
- return 1;
- }
- //==============================================================================
- public OnPlayerConnect ( playerid )
- {
- Spawned [ playerid ] = 0;
- return 1;
- }
- //==============================================================================
- public OnPlayerSpawn ( playerid )
- {
- Spawned [ playerid ] = 1;
- return 1;
- }
- //==============================================================================
- public OnPlayerDeath ( playerid , killerid , reason )
- {
- Spawned [ playerid ] = 0;
- return 1;
- }
- //==============================================================================
- stock BanWeapon ( weaponid )
- {
- BannedWeapons [ MAX_BANNED_WEAPONS ] = weaponid;
- MAX_BANNED_WEAPONS = MAX_BANNED_WEAPONS += 1;
- return MAX_BANNED_WEAPONS - 1;
- }
- //==============================================================================
- stock BanWithMessage ( playerid )
- {
- TextDrawShowForPlayer ( playerid , BanMessage );
- TogglePlayerControllable ( playerid , 0 );
- GameTextForPlayer ( playerid , " " , 100000000000000 , 1 );
- Ban ( playerid );
- new string [ 256 ] , weaponname [ 256 ] , weaponid;
- weaponid = GetPlayerWeapon ( playerid );
- GetWeaponName ( weaponid , weaponname , 256 );
- SendClientMessageToAll(COLOR_RED,"____________________________________________________________________________________");
- format(string, sizeof(string), "Anti Cheat has banned %s (player: %d) from the server." , GetName ( playerid ) , playerid );
- SendClientMessageToAll(COLOR_WHITE, string);
- printf(string);
- format(string, sizeof(string), "Reason: Hacked weapon (%s)." , weaponname );
- SendClientMessageToAll(COLOR_WHITE, string);
- printf(string);
- SendClientMessageToAll(COLOR_RED,"____________________________________________________________________________________");
- }
- //==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment