Raised This Month: $ Target: $400
 0% 

Jailbreak Box can kill each other CT


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-16-2014 , 15:29   Re: Jailbreak Box can kill each other CT
Reply With Quote #2

use ( set_pcvar_num ) instead of ( server_cmd )

PHP Code:
new g_cvar_box

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_clcmd"say /box""cmdBox" );
    
    
register_logevent"CmdRoundStart"2"1=Round_Start" );
    
RegisterHamHam_TakeDamage"player""HamTakeDamage" );
    
    
g_cvar_box get_cvar_pointer("mp_friendlyfire")
}

public 
CmdRoundStart()
{
    
set_pcvar_num(g_cvar_box0)
}

public 
cmdBoxclient )
{              
    if ( !
is_user_aliveclient ) || cs_get_user_teamclient ) != CS_TEAM_CT )
    {
          
ColorChatclientGREEN"[Jailbreak] ^1You must to be^x03 Alive Guards^x01 to do this^x04 command.");
          return 
PLUGIN_HANDLED
    
}
    
    new 
szMenu50 ], iMenu;
    
formatexszMenucharsmaxszMenu ), "\r[Jailbreak] \wBox Menu \d/*Built By \yCheezPuff\d");

    
iMenu menu_createszMenu"sub_box" );
    
    
menu_additemiMenu"Box \yActive");
    
menu_additemiMenu"Box \yDeactive^n");
    
menu_additemiMenu"Reset Health : \r[ \wTerrorist \r]" );

    
menu_displayclientiMenu);
    return 
PLUGIN_CONTINUE;
}

public 
sub_box(clientiMenuitem)
{      
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(iMenu)
        return 
PLUGIN_HANDLED
    
}
       
    switch( 
item )
    {
        case 
0:
        {
            
set_pcvar_num(g_cvar_box1)
            
set_hudmessage(random_num(1,250), random_num(1,255), random_num(1,256), -1.0, -1.006.012.0);
            
show_hudmessage(0"Gurad: %s - Active Box"GetUserName(client));
            
ColorChat0GREEN"[Jailbreak]^1 Guard:^3 %s ^1- Active ^4Box"GetUserName(client) );
        }
        
        case 
1:
        {
            
set_pcvar_num(g_cvar_box1)
            
set_hudmessage(random_num(1,255), random_num(1,255), random_num(1,255), -1.0, -1.006.012.0);
            
show_hudmessage(0"Gurad: %s - Disactived JailBreak Box"GetUserName(client));
            
ColorChat0GREEN"[Jailbreak]^1 Guard:^3 %s ^1- Disactived ^4Box"GetUserName(client) );
        }
        
        case 
2:
        {
               new 
players32 ], pnum;
               
get_playersplayerspnum"aceh""TERRORIST" );
               
               for(new 
0pnumi++)
                        
fm_set_user_healthplayers[i], 100 );
 
               
ColorChat0GREEN"[Jailbreak]^3 %s^1 has reseted HP To ^4Prisoner's^1 Team!"GetUserName(client));
               
               
cmdBoxclient );
        }              
    }
    return 
PLUGIN_HANDLED
}

public 
HamTakeDamagevictiminflictorattackerFloat:damagedamagebits )
{
        if (!
get_pcvar_num(g_cvar_box))
                       return 
HAM_IGNORED
        
if ( (!is_user_connectedattacker ) || !is_user_aliveattacker ))  && (!is_user_connected(victim) || !is_user_alivevictim )))
                return 
HAM_IGNORED;
       
        static 
CsTeams:AteamCsTeams:Vteam
        Ateam 
cs_get_user_team(attacker)
        
Vteam cs_get_user_team(victim)
        if(
Ateam == CS_TEAM_CT && Vteam == CS_TEAM_CT)
                   return 
HAM_SUPERCEDE
        
return HAM_IGNORED
}

stock GetUserNameclient )
{
    static 
szName32 ];
    
    
get_user_nameclientszNamecharsmaxszName ) );
    
    return 
szName;


Last edited by Natsheh; 10-17-2014 at 11:15. Reason: Fixing
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
 



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 17:35.


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