Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Plugin generated by AMXX-Studio */
- #include < amxmodx >
- #include < cstrike >
- #include < fakemeta_util >
- #include < hamsandwich >
- #include < ColorChat >
- #define PLUGIN "Jailbreak Box Menu"
- #define VERSION "1.3"
- #define AUTHOR "CheezPuff" // Steam: CheezPuff
- public plugin_init()
- {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- register_clcmd( "say /box", "cmdBox" );
- register_clcmd( "say_team /box", "cmdBox" );
- register_logevent( "CmdRoundStart", 2, "1=Round_Start" );
- RegisterHam( Ham_TakeDamage, "player", "HamTakeDamage" );
- }
- public CmdRoundStart()
- {
- server_cmd( "mp_friendlyfire 0" );
- }
- public cmdBox( client )
- {
- if ( !is_user_alive( client ) || cs_get_user_team( client ) != CS_TEAM_CT )
- {
- ColorChat( client, GREEN, "[Jailbreak] ^1You must to be^x03 Alive Guards^x01 to do this^x04 command.");
- return 1;
- }
- new szMenu[ 50 ], iMenu;
- formatex( szMenu, charsmax( szMenu ), "\r[Jailbreak] \wBox Main Menu");
- iMenu = menu_create( szMenu, "sub_boxmenu" );
- menu_additem( iMenu, "Box \yActive");
- menu_additem( iMenu, "Box \yDeactive^n");
- menu_additem( iMenu, "Reset Health : \r[ \wTerrorist \r]" );
- menu_display( client, iMenu, 0 );
- return PLUGIN_HANDLED;
- }
- public sub_boxmenu(client, iMenu, item)
- {
- if ( cs_get_user_team( client ) != CS_TEAM_CT )
- {
- ColorChat( client, GREEN, "[Jailbreak] ^3Error:^1 You have^x03 no access^x01 to this command.");
- return 1;
- }
- if( item == MENU_EXIT || !is_user_alive(client))
- return 1;
- switch (item)
- {
- case 0:
- {
- server_cmd( "mp_friendlyfire 1" );
- set_hudmessage( 0, 85, 255, 0.05, 0.54, 1, 1.0, 1.5 );
- show_hudmessage(client, "%s has Enable the Box.", GetUserName( client ) );
- ColorChat( 0, GREEN, "[Jailbreak]^3 %s ^1has^4 Enable^1 the ^4Box.", GetUserName( client ) );
- cmdBox(client)
- }
- case 1:
- {
- server_cmd( "mp_friendlyfire 0" );
- set_hudmessage( 0, 85, 255, 0.05, 0.54, 1, 3.0, 5.0 );
- show_hudmessage(client, "%s has Disable the Box.", GetUserName( client ) );
- ColorChat( 0, GREEN, "[Jailbreak]^3 %s ^1has^4 Disable^1 the ^4Box.", GetUserName( client ) );
- cmdBox(client)
- }
- case 2:
- {
- new players[ 32 ], num;
- get_players( players, num, "aceh", "TERRORIST" );
- for ( new i = 0; i < num; i++ )
- fm_set_user_health( players[ i ], 100 );
- ColorChat( 0, GREEN, "[Jailbreak]^3 %s^1 has Reseted HP To ^4Prisoner's^1 Team!",GetUserName( client ));
- cmdBox(client)
- }
- }
- return 1;
- }
- public HamTakeDamage( victim, inflictor, attacker, Float:damage, damagebits )
- {
- if ( attacker == victim || !is_user_alive( attacker ) || !is_user_alive( victim ))
- return HAM_IGNORED;
- return ( cs_get_user_team( attacker ) == CS_TEAM_CT && cs_get_user_team( victim ) == cs_get_user_team( attacker ) ? HAM_SUPERCEDE : HAM_IGNORED);
- }
- stock GetUserName( index )
- {
- static name[ 32 ];
- get_user_name( index, name, charsmax( name ) );
- return name;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement