Advertisement
CheezPuff

JailBreak Box System

Aug 20th, 2013
1,567
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.11 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include < amxmodx >
  4. #include < cstrike >
  5. #include < fakemeta_util >
  6. #include < hamsandwich >
  7. #include < ColorChat >
  8.  
  9. #define PLUGIN "Jailbreak Box Menu"
  10. #define VERSION "1.3"
  11. #define AUTHOR "CheezPuff" // Steam: CheezPuff
  12.  
  13. public plugin_init()
  14. {
  15.     register_plugin(PLUGIN, VERSION, AUTHOR)
  16.    
  17.     register_clcmd( "say /box", "cmdBox" );
  18.     register_clcmd( "say_team /box", "cmdBox" );
  19.    
  20.     register_logevent( "CmdRoundStart", 2, "1=Round_Start" );
  21.     RegisterHam( Ham_TakeDamage, "player", "HamTakeDamage" );
  22. }
  23.  
  24. public CmdRoundStart()
  25. {
  26.     server_cmd( "mp_friendlyfire 0" );
  27. }
  28.  
  29. public cmdBox( client )
  30. {              
  31.     if ( !is_user_alive( client ) || cs_get_user_team( client ) != CS_TEAM_CT )
  32.     {
  33.         ColorChat( client, GREEN, "[Jailbreak] ^1You must to be^x03 Alive Guards^x01 to do this^x04 command.");
  34.         return 1;
  35.     }
  36.    
  37.     new szMenu[ 50 ], iMenu;
  38.     formatex( szMenu, charsmax( szMenu ), "\r[Jailbreak] \wBox Main Menu");
  39.    
  40.     iMenu = menu_create( szMenu, "sub_boxmenu" );
  41.    
  42.     menu_additem( iMenu, "Box \yActive");
  43.     menu_additem( iMenu, "Box \yDeactive^n");
  44.     menu_additem( iMenu, "Reset Health : \r[ \wTerrorist \r]" );
  45.    
  46.     menu_display( client, iMenu, 0 );
  47.     return PLUGIN_HANDLED;
  48. }
  49.  
  50. public sub_boxmenu(client, iMenu, item)
  51. {
  52.     if ( cs_get_user_team( client ) != CS_TEAM_CT )
  53.     {
  54.         ColorChat( client, GREEN, "[Jailbreak] ^3Error:^1 You have^x03 no access^x01 to this command.");
  55.        
  56.         return 1;
  57.     }
  58.    
  59.     if( item == MENU_EXIT || !is_user_alive(client))
  60.         return 1;
  61.    
  62.     switch (item)
  63.     {
  64.         case 0:
  65.         {
  66.             server_cmd( "mp_friendlyfire 1" );
  67.             set_hudmessage( 0, 85, 255, 0.05, 0.54, 1, 1.0, 1.5 );
  68.             show_hudmessage(client, "%s has Enable the Box.", GetUserName( client ) );
  69.             ColorChat( 0, GREEN, "[Jailbreak]^3 %s ^1has^4 Enable^1 the ^4Box.", GetUserName( client ) );
  70.            
  71.             cmdBox(client)
  72.         }
  73.        
  74.         case 1:
  75.         {
  76.             server_cmd( "mp_friendlyfire 0" );
  77.             set_hudmessage( 0, 85, 255, 0.05, 0.54, 1, 3.0, 5.0 );
  78.             show_hudmessage(client, "%s has Disable the Box.", GetUserName( client ) );
  79.             ColorChat( 0, GREEN, "[Jailbreak]^3 %s ^1has^4 Disable^1 the ^4Box.", GetUserName( client ) );
  80.            
  81.             cmdBox(client)
  82.         }
  83.                
  84.         case 2:
  85.         {
  86.             new players[ 32 ], num;
  87.                        
  88.             get_players( players, num, "aceh", "TERRORIST" );
  89.                        
  90.             for ( new i = 0; i < num; i++ )
  91.                 fm_set_user_health( players[ i ], 100 );
  92.             ColorChat( 0, GREEN, "[Jailbreak]^3 %s^1 has Reseted HP To ^4Prisoner's^1 Team!",GetUserName( client ));
  93.                
  94.             cmdBox(client) 
  95.         }
  96.     }
  97.     return 1;
  98. }
  99.  
  100. public HamTakeDamage( victim, inflictor, attacker, Float:damage, damagebits )
  101. {
  102.     if ( attacker == victim || !is_user_alive( attacker ) || !is_user_alive( victim ))
  103.         return HAM_IGNORED;
  104.    
  105.     return ( cs_get_user_team( attacker ) == CS_TEAM_CT && cs_get_user_team( victim ) == cs_get_user_team( attacker ) ?  HAM_SUPERCEDE : HAM_IGNORED);
  106. }
  107. stock GetUserName( index )
  108. {
  109.     static name[ 32 ];
  110.    
  111.     get_user_name( index, name, charsmax( name ) );
  112.    
  113.     return name;
  114. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement