Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Plugin generated by AMXX-Studio */
- #include < amxmodx >
- #include < fakemeta >
- new const plugin_info[ 3 ][ ] =
- {
- "Open & Close Cells",
- "v0.1",
- "+ColdWar"
- }
- public plugin_init() {
- register_plugin( plugin_info[ 0 ] , plugin_info[ 1 ] , plugin_info[ 2 ] )
- register_clcmd( "say /close", "CmdCloseCells" );
- register_clcmd( "say !close", "CmdCloseCells" );
- register_clcmd( "say /open", "CmdOpenCells" );
- register_clcmd( "say !open", "CmdOpenCells" );
- }
- public CmdOpenCells( client )
- {
- if( ( get_user_team( client ) != 2 || !is_user_alive( client ) ) && !( get_user_flags( client ) & ADMIN_KICK ) )
- return 1;
- new szName[ 32 ];
- get_user_name( client, szName, sizeof szName - 1 );
- client_print( 0, 3, "%s has opened the cells!", szName );
- 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 CmdCloseCells( client )
- {
- if( ( get_user_team( client ) != 2 || !is_user_alive( client ) ) && !( get_user_flags( client ) & ADMIN_KICK ) )
- return 1;
- new szName[ 32 ];
- get_user_name( client, szName, sizeof szName - 1 );
- client_print( 0, 3, "%s has closed the cells!", szName );
- 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;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement