Guest User

Wrath Of Genesis

a guest
Apr 17th, 2008
575
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.72 KB | None | 0 0
  1. //==============================================================================
  2.  
  3. #include <a_samp>
  4.  
  5. //==============================================================================
  6.  
  7. // Red
  8.  
  9. #define COLOR_DARKRED 0x660000AA
  10. #define COLOR_LIGHTRED 0xFF99AADD
  11.  
  12. // Blue
  13.  
  14. #define COLOR_SWAT_BLUE 0x0000FFAA
  15. #define COLOR_NEUTRALBLUE 0xABCDEF01
  16. #define COLOR_LIGHTBLUE 0x33CCFFAA
  17. #define COLOR_BLUE 0x0000BBAA
  18. #define COLOR_VIOLET 0x9955DEEE
  19. #define COLOR_LIGHTCYAN 0xAAFFCC33
  20.  
  21. // Green
  22.  
  23. #define COLOR_LIGHTGREEN 0x24FF0AB9
  24. #define COLOR_SEAGREEN 0x00EEADDF
  25. #define COLOR_GREEN 0x33AA33AA
  26.  
  27. // Other
  28.  
  29. #define COLOR_PINK 0xFF66FFAA
  30. #define COLOR_PURPLE 0x800080AA
  31.  
  32. #define COLOR_NEUTRAL 0xABCDEF97
  33. #define COLOR_GLOBAL 0xD0D0FFAA
  34.  
  35. // Rainbow
  36.  
  37. #define COLOR_RED 0xFF0000AA
  38. #define COLOR_ORANGE 0xFF9900AA
  39. #define COLOR_YELLOW 0xFFFF00AA
  40. #define COLOR_GREEN 0x33AA33AA
  41. #define COLOR_BLUE 0x0000BBAA
  42. #define COLOR_VIOLET 0x9955DEEE
  43.  
  44. // Black - White
  45.  
  46. #define COLOR_WHITE 0xFFFFFF00
  47. #define COLOR_GREY 0xAFAFAFAA
  48. #define COLOR_BLACK 0x000000AA
  49.  
  50. //==============================================================================
  51.  
  52. new Text: BanMessage;
  53.  
  54. //==============================================================================
  55.  
  56. forward BannedWeaponCheck ( );
  57.  
  58. //==============================================================================
  59.  
  60. new BannedWeapons [ 999 ];
  61.  
  62. new MAX_BANNED_WEAPONS = 0;
  63.  
  64. new Spawned [ MAX_PLAYERS ];
  65.  
  66. //==============================================================================
  67.  
  68. public OnFilterScriptInit ( )
  69. {
  70. //BanWeapon ( 38 ); // An example of how to ban a weapon, in this case: weapon id 38 (minigun)
  71.  
  72. SetTimer ( "BannedWeaponCheck" , 1000 , true );
  73.  
  74. BanMessage = TextDrawCreate ( 150 , 200 , "~r~You have been Banned from the server!~n~~w~Please disconnect" );
  75. TextDrawLetterSize ( BanMessage , 0.5 , 1.8 );
  76. TextDrawBoxColor ( BanMessage , COLOR_BLACK );
  77. TextDrawBackgroundColor ( BanMessage , COLOR_BLACK );
  78. TextDrawUseBox ( BanMessage , 1 );
  79. TextDrawFont ( BanMessage , 3 );
  80. TextDrawSetOutline ( BanMessage , 1 );
  81.  
  82. return 1;
  83. }
  84.  
  85. //==============================================================================
  86.  
  87. public BannedWeaponCheck ( )
  88. {
  89. for ( new playerid = 0; playerid < MAX_PLAYERS; playerid ++ )
  90. {
  91. for ( new weaponid = 0; weaponid < MAX_BANNED_WEAPONS; weaponid ++ )
  92. {
  93. if ( GetPlayerWeapon ( playerid ) == BannedWeapons [ weaponid ] && Spawned [ playerid ] == 1 )
  94. {
  95. Ban ( playerid );
  96. }
  97. }
  98. }
  99. }
  100.  
  101. //==============================================================================
  102.  
  103. public OnPlayerDisconnect ( playerid , reason )
  104. {
  105. Spawned [ playerid ] = 0;
  106.  
  107. return 1;
  108. }
  109.  
  110. //==============================================================================
  111.  
  112. public OnPlayerConnect ( playerid )
  113. {
  114. Spawned [ playerid ] = 0;
  115.  
  116. return 1;
  117. }
  118.  
  119. //==============================================================================
  120.  
  121. public OnPlayerSpawn ( playerid )
  122. {
  123. Spawned [ playerid ] = 1;
  124.  
  125. return 1;
  126. }
  127.  
  128. //==============================================================================
  129.  
  130. public OnPlayerDeath ( playerid , killerid , reason )
  131. {
  132. Spawned [ playerid ] = 0;
  133.  
  134. return 1;
  135. }
  136.  
  137. //==============================================================================
  138.  
  139. stock BanWeapon ( weaponid )
  140. {
  141. BannedWeapons [ MAX_BANNED_WEAPONS ] = weaponid;
  142.  
  143. MAX_BANNED_WEAPONS = MAX_BANNED_WEAPONS += 1;
  144.  
  145. return MAX_BANNED_WEAPONS - 1;
  146. }
  147.  
  148. //==============================================================================
  149.  
  150. stock BanWithMessage ( playerid )
  151. {
  152. TextDrawShowForPlayer ( playerid , BanMessage );
  153. TogglePlayerControllable ( playerid , 0 );
  154. GameTextForPlayer ( playerid , " " , 100000000000000 , 1 );
  155. Ban ( playerid );
  156.  
  157. new string [ 256 ] , weaponname [ 256 ] , weaponid;
  158.  
  159. weaponid = GetPlayerWeapon ( playerid );
  160.  
  161. GetWeaponName ( weaponid , weaponname , 256 );
  162.  
  163. SendClientMessageToAll(COLOR_RED,"____________________________________________________________________________________");
  164. format(string, sizeof(string), "Anti Cheat has banned %s (player: %d) from the server." , GetName ( playerid ) , playerid );
  165. SendClientMessageToAll(COLOR_WHITE, string);
  166. printf(string);
  167. format(string, sizeof(string), "Reason: Hacked weapon (%s)." , weaponname );
  168. SendClientMessageToAll(COLOR_WHITE, string);
  169. printf(string);
  170. SendClientMessageToAll(COLOR_RED,"____________________________________________________________________________________");
  171. }
  172.  
  173.  
  174.  
  175. //==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment