Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Plugin generated by AMXX-Studio */
- #include < amxmodx >
- #include < amxmisc >
- #include < cstrike >
- #include < fakemeta_util >
- #define OWNER_ACCESS ADMIN_IMMUNITY
- new Info[ 4 ][ ] = {
- "JailBreak Menu open & close the cages",
- "1.0",
- "EB0Y",
- "AMXX" // Prefix
- };
- public plugin_init() {
- register_plugin( Info[ 0 ], Info[ 1 ], Info[ 2 ] );
- register_clcmd( "say /open", "Opencages" )
- register_clcmd( "say /close", "Closecages" )
- register_clcmd( "say /open", "Opencagesadmin" )
- register_clcmd( "say /close", "Closecagesadmin" )
- //register_saycmd( "cages_menu", "CmdMainMenu", 0, "Open & Close the cages menu" );
- }
- /*public CmdMainMenu( client )
- {
- if ( !is_user_alive( client ) || ! is_user_connected( client ) )
- return 1;
- else if ( ! access( client, OWNER_ACCESS ) )
- return ColorChat( client, "You have no^x04 access^x01 to this command" );
- new Menu = menu_create( "\w[\rJailBreak\w]\y Open & Close the cages Menu", "MainMenuHandler" );
- menu_additem( Menu, "Open the cages" );
- menu_additem( Menu, "Close the cages" );
- menu_setprop( Menu, MPROP_EXITNAME, "\wExit" );
- menu_display( client, Menu );
- return 1;
- }*/
- public MainMenuHandler( client, Menu, Item )
- {
- if ( Item == MENU_EXIT )
- return menu_destroy( Menu );
- switch ( Item )
- {
- case 0: Opencages( client );
- case 1: Closecages( client );
- }
- menu_display( client, Menu, 0 );
- return 1;
- }
- public Opencages( client )
- {
- if( ( get_user_team( client ) != 2 || !is_user_alive( client ) && get_user_team(client) == 2 ) )
- return 1;
- ColorChat( 0, "^x03Owner^x01:^x04 %s^x01 has^x03 opened^x01 the cages.", GetUserName( client ) );
- new ent = -1
- while( (ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door" ) ) )
- dllfunc( DLLFunc_Use, ent, 0 );
- ent = -1
- while( ( ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door_rotating" ) ) )
- dllfunc( DLLFunc_Use, ent, 0 );
- return 0;
- }
- public Opencagesadmin( client )
- {
- if(is_user_admin(client) && is_user_connected(client))
- return 1;
- ColorChat( 0, "^x03Owner^x01:^x04 %s^x01 has^x03 opened^x01 the cages.", GetUserName( client ) );
- new ent = -1
- while( (ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door" ) ) )
- dllfunc( DLLFunc_Use, ent, 0 );
- ent = -1
- while( ( ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door_rotating" ) ) )
- dllfunc( DLLFunc_Use, ent, 0 );
- return 0;
- }
- public Closecages( client )
- {
- if( ( get_user_team( client ) != 2 || !is_user_alive( client ) && get_user_team(client) == 2 ) )
- return 1;
- ColorChat( 0, "^x03Owner^x01:^x04 %s^x01 has^x03 closed^x01 the cages.", GetUserName( client ) );
- new ent = -1
- while( (ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door" ) ) )
- dllfunc( DLLFunc_Think, ent, 0 );
- ent = -1
- while( ( ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door_rotating" ) ) )
- dllfunc( DLLFunc_Think, ent, 0 );
- return 0;
- }
- public Closecagesadmin( client )
- {
- if(is_user_admin(client) && is_user_connected(client))
- return 1;
- ColorChat( 0, "^x03Owner^x01:^x04 %s^x01 has^x03 closed^x01 the cages.", GetUserName( client ) );
- new ent = -1
- while( (ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door" ) ) )
- dllfunc( DLLFunc_Think, ent, 0 );
- ent = -1
- while( ( ent = engfunc( EngFunc_FindEntityByString, ent, "classname", "func_door_rotating" ) ) )
- dllfunc( DLLFunc_Think, ent, 0 );
- return 0;
- }
- stock bool:is_user_can_owner( client )
- {
- if ( ! get_user_flags( client ) & OWNER_ACCESS )
- return false;
- return true;
- }
- /*stock register_saycmd( iSaycommand[ ], iFunction[ ], iFlags, iInfo[ ] )
- {
- new iTypes[ ] = { "say", "say_team" };
- new iSigns[ ] = { "!", ".", "/" };
- new iTemp[ 64 ];
- for ( new i = 0; i < sizeof( iTypes ); i++ )
- {
- for ( new j = 0; j < sizeof( iSigns ); j++ )
- {
- format( iTemp, charsmax( iTemp ), "%s %s%s", iTypes[ i ], iSigns[ j ], iSaycommand );
- register_clcmd( iTemp, iFunction, iFlags, iInfo );
- }
- }
- }*/
- stock GetUserName( index )
- {
- static name[ 32 ];
- get_user_name( index, name, charsmax( name ) );
- return name;
- }
- stock ColorChat( const id, const string[], any:... )
- {
- new msg[191], players[32], count = 1;
- static len; len = formatex( msg, charsmax(msg), "^x04[JailBreak]^x01 " );
- vformat( msg[len], charsmax(msg) - len, string, 3 );
- if(id) players[0] = id;
- else get_players( players,count,"ch" );
- for (new i = 0; i < count; i++)
- {
- if(is_user_connected(players[i]))
- {
- message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"),_, players[i]);
- write_byte(players[i]);
- write_string(msg);
- message_end();
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement