Raised This Month: $51 Target: $400
 12% 

[REQ] Open command edit


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Versus1994
Senior Member
Join Date: Jan 2013
Old 08-05-2014 , 14:40   [REQ] Open command edit
Reply With Quote #1

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 );
       
}

Last edited by Versus1994; 08-05-2014 at 18:33.
Versus1994 is offline
Old 08-05-2014, 15:50
InsanityKARAI
This message has been deleted by InsanityKARAI.
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 08-05-2014 , 15:53   Re: [REQ] Open command edit
Reply With Quote #2

Enjoy
PHP Code:
#include < amxmodx >
#include < fakemeta >
#include < colorchat >
 
#pragma semicolon 1
 
#define PREFIX  "Jailbreak"
 
public plugin_init( )
{
        
register_plugin"Jailbreak: Open Cells""0.0.1""Salvaje" );
       
        
register_saycmd"open""cmd_fnOpenCells" );
       
}
 
public 
cmd_fnOpenCellsid )
{
    if ( !
is_user_connectedid ) )
        return 
1;
    
    if ( 
id )
    {
        if ( 
cs_get_user_teamid ) != CS_TEAM_CT && !accessidADMIN_KICK ) )
        {
            
ColorChatidRED"^4[ %s ]^1 You have^3 no access^1 to this^4 command^1."PREFIX );
            
            return 
1;
        }
        
        if ( !
is_user_aliveid ) && !accessidADMIN_KICK ) )
        {
            
ColorChatidRED"^4[ %s ]^1 You have^3 no access^1 to this^4 command^1."PREFIX );
            
            return 
1;
        }
    }
       
        
fn_Cellsid );
        return 
1;
}
 
public 
fn_Cellsid )
{
        static 
szName32 ], iEnt;
        
get_user_nameidszNamesizeof szName );
       
        
ColorChatidRED"^4[ %s ] ^3 %s^1 has opened the^4 Cells^1."PREFIXszName );
       
        
iEnt = -1;
        while( ( 
iEnt engfuncEngFunc_FindEntityByStringiEnt"classname""func_door" ) ) != )
                
dllfuncDLLFunc_UseiEnt);
}
 
register_saycmdcommand[ ], function[ ] )
{
        static 
Output64 ];
        
formatexOutputsizeof Output 1"say %s"command );
        
register_clcmdOutput, function );
       
        
formatexOutputsizeof Output 1"say .%s"command );
        
register_clcmdOutput, function );
       
        
formatexOutputsizeof Output 1"say !%s"command );
        
register_clcmdOutput, function );
       
        
formatexOutputsizeof Output 1"say /%s"command );
        
register_clcmdOutput, function );
       


Last edited by Fuck For Fun; 08-05-2014 at 16:30.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Versus1994
Senior Member
Join Date: Jan 2013
Old 08-05-2014 , 18:04   Re: [REQ] Open command edit
Reply With Quote #3

Doesnt compile, 2 errors. ;/

One about cs_get_user_team another access.

Last edited by Versus1994; 08-05-2014 at 18:14.
Versus1994 is offline
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 08-05-2014 , 18:11   Re: [REQ] Open command edit
Reply With Quote #4

Quote:
Originally Posted by Versus1994 View Post
Doesnt compile, lots of errors. ;/
You have to compile locally if he is including colorchat. you will also need the colorchat.inc
__________________

Last edited by joshknifer; 08-05-2014 at 18:12.
joshknifer is offline
Send a message via Skype™ to joshknifer
Versus1994
Senior Member
Join Date: Jan 2013
Old 08-05-2014 , 18:18   Re: [REQ] Open command edit
Reply With Quote #5

I'm compiling on my PC, so I think its local, and I really have colorchat.inc, I compiled it before editing it worked.
Versus1994 is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 08-05-2014 , 18:35   Re: [REQ] Open command edit
Reply With Quote #6

Quote:
Originally Posted by Versus1994 View Post
Doesnt compile, 2 errors. ;/

One about cs_get_user_team another access.
Change this part

Code:
#include < amxmodx > #include < fakemeta > #include < colorchat >

To.

Code:
#include < amxmodx > #include < amxmisc > #include < fakemeta > #include < cstrike > #include < colorchat >
__________________

Last edited by Blizzard_87; 08-05-2014 at 18:47.
Blizzard_87 is offline
Versus1994
Senior Member
Join Date: Jan 2013
Old 08-05-2014 , 19:23   Re: [REQ] Open command edit
Reply With Quote #7

It compiled, but Terrorist can also use open command :/
Versus1994 is offline
NikKOo31
Senior Member
Join Date: May 2013
Location: Home
Old 08-05-2014 , 19:50   Re: [REQ] Open command edit
Reply With Quote #8

PHP Code:
public cmd_fnOpenCellsid )
{
    if(!
is_user_connected(id))
        return 
1;

    if(
cs_get_user_teamid ) == CS_TEAM_CT || access(idADMIN_KICK))
    {
        
fn_Cells(id);
    }
    else
    {
        
ColorChatidRED"^4[ %s ]^1 You have^3 no access^1 to this^4 command^1."PREFIX );
    }

    return 
PLUGIN_HANDLED;

__________________
Hey ^_^

Last edited by NikKOo31; 08-05-2014 at 19:53.
NikKOo31 is offline
Versus1994
Senior Member
Join Date: Jan 2013
Old 08-06-2014 , 06:30   Re: [REQ] Open command edit
Reply With Quote #9

NikKOo31 - still Terrorists can also open the cells. ://
Versus1994 is offline
Versus1994
Senior Member
Join Date: Jan 2013
Old 08-06-2014 , 07:26   Re: [REQ] Open command edit
Reply With Quote #10

K guys I made it a little different and I'm okay with that, so thanks for the help!
Versus1994 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:07.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode