Raised This Month: $ Target: $400
 0% 

Jailbreak Box can kill each other CT


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 10-16-2014 , 17:55   Re: Jailbreak Box can kill each other CT
Reply With Quote #3

Quote:
Originally Posted by Natsheh View Post
use ( set_cvar_num ) instead of ( server_cmd )

PHP Code:
public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)

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

public 
CmdRoundStart()
{
    
server_cmd"mp_friendlyfire 0" );
}

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_cvar_num("mp_friendlyfire"1)
            
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"szName);
            
ColorChat0GREEN"[Jailbreak]^1 Guard:^3 %s ^1- Active ^4Box"szNameclient ) );
        }
        
        case 
1:
        {
            
set_cvar_num("mp_friendlyfire"0)
            
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",szName);
            
ColorChat0GREEN"[Jailbreak]^1 Guard:^3 %s ^1- Disactived ^4Box"szNameclient ) );
        }
        
        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!"szNameclient ));
                        
                           
cmdBoxclient );
                           return 
PLUGIN_CONTINUE;
                }              
        }
 
        return 
PLUGIN_HANDLED;
}

public 
HamTakeDamagevictiminflictorattackerFloat:damagedamagebits )
{
        if ( (!
is_user_connectedattacker ) || !is_user_aliveattacker ))  && (!is_user_connectedvictim ) || !is_user_alivevictim ))
                return 
HAM_IGNORED;
       
        new 
Ateam fm_get_user_team(attacker)
        new 
Vteam fm_get_user_team(victim)
        if(
Ateam == CS_TEAM_CT && Vteam == CS_TEAM_CT)
                   return 
HAM_SUPERCEDE
        HAM_IGNORE
}

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

i got 2 error:

Code:
public HamTakeDamage( victim, inflictor, attacker, Float:damage, damagebits )
{
        if ( (!is_user_connected( attacker ) || !is_user_alive( attacker ))  && (!is_user_connected( victim ) || !is_user_alive( victim ) )
                return HAM_IGNORED;
       
        new Ateam = cs_get_user_team(attacker)
        new Vteam = cs_get_user_team(victim)
        if(Ateam == CS_TEAM_CT && Vteam == CS_TEAM_CT)
                   return HAM_SUPERCEDE
        HAM_IGNORE
}
why u add HAM_IGNORE line?
and i think u missed more )
in last line
Code:
!is_user_alive( victim ) )
>
Code:
!is_user_alive( victim ) ) )
Code:
Warning: Function "HamTakeDamage" should return a value

Last edited by Fuck For Fun; 10-16-2014 at 17:56.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
 



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