Hey guys, I need a small edit to "open" command in jailbreak mod.
The edit is : so that "open" command would only work on CT team. Would be thankful if someone could help me out.
CODE:
Code:
#include < amxmodx >
#include < fakemeta >
#include < colorchat >
#pragma semicolon 1
#define PREFIX "Jailbreak"
#define ACCESS_OC ADMIN_KICK
public plugin_init( )
{
register_plugin( "Jailbreak: Open Cells", "0.0.1", "Salvaje" );
register_saycmd( "open", "cmd_fnOpenCells" );
}
public cmd_fnOpenCells( id )
{
if( !( get_user_flags( id ) & ACCESS_OC ) )
{
ColorChat( id, RED, "^4[ %s ]^1 You have^3 no access^1 to this^4 command^1.", PREFIX );
return 1;
}
fn_Cells( id );
return 1;
}
public fn_Cells( id )
{
static szName[ 32 ], iEnt;
get_user_name( id, szName, sizeof szName - 1 );
ColorChat( id, RED, "^4[ %s ]^1 ADMIN:^3 %s^1 has opened the^4 Cells^1.", PREFIX, szName );
iEnt = -1;
while( ( iEnt = engfunc( EngFunc_FindEntityByString, iEnt, "classname", "func_door" ) ) != 0 )
dllfunc( DLLFunc_Use, iEnt, 0 );
}
register_saycmd( command[ ], function[ ] )
{
static Output[ 64 ];
formatex( Output, sizeof Output - 1, "say %s", command );
register_clcmd( Output, function );
formatex( Output, sizeof Output - 1, "say .%s", command );
register_clcmd( Output, function );
formatex( Output, sizeof Output - 1, "say !%s", command );
register_clcmd( Output, function );
formatex( Output, sizeof Output - 1, "say /%s", command );
register_clcmd( Output, function );
}