Raised This Month: $32 Target: $400
 8% 

[ZP v4.3] Block suicide


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MarLeo94
Junior Member
Join Date: Jul 2013
Location: Reino de Europa.
Old 03-24-2015 , 19:24   [ZP v4.3] Block suicide
Reply With Quote #1

Hello, I have the following code assumes that serves to block suicide, is controlled by a cvar (0 off, 1 zombies can not commit suicide, 2 humans can not commit suicide, 3 no one can commit suicide), the problem is that does not work, what's the problem?

PHP Code:
cvar_blocksuicide register_cvar("zp_block_suicide""1"// 0 nobody, 1 zombies, 2 humans, 3 all 
PHP Code:
// Client Kill Forward
public fw_ClientKill(id)
{
    if(!
is_user_alive(id) && !is_user_connected(id)) {
        return 
FMRES_IGNORED;
    }
    
    
// Prevent players from killing themselves?
    
if(get_pcvar_num(cvar_blocksuicide) == && cs_get_user_team(id) == CS_TEAM_T) {
        
client_print(idprint_chat"[ZP] Los zombies no pueden suicidarse.");
        
client_print(idprint_console"[ZP] Los zombies no pueden suicidarse.");
        
        return 
FMRES_SUPERCEDE;
    }
    else if(
get_pcvar_num(cvar_blocksuicide) == && cs_get_user_team(id) == CS_TEAM_CT) {
        
client_print(idprint_chat"[ZP] Los humanos no pueden suicidarse.");
        
client_print(idprint_console"[ZP] Los humanos no pueden suicidarse.");
        
        return 
FMRES_SUPERCEDE;
    }
    else if(
get_pcvar_num(cvar_blocksuicide) == 3) {
        
client_print(idprint_chat"[ZP] No puedes suicidarte.");
        
client_print(idprint_console"[ZP] No puedes suicidarte.");
        
        return 
FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED;

PHP Code:
// 7. Join spec
    
if(!g_isalive[id] || get_pcvar_num(cvar_blocksuicide) == || (userflags g_access_flag[ACCESS_ADMIN_MENU])) {
        if((
get_pcvar_num(cvar_blocksuicide) == && cs_get_user_team(id) == CS_TEAM_CT
        || (
get_pcvar_num(cvar_blocksuicide) == && cs_get_user_team(id) == CS_TEAM_T)) {
            
len += formatex(menu[len], charsmax(menu) - len"\r7.\w %L^n^n"id"MENU_SPECTATOR")
        }
        else if(
get_pcvar_num(cvar_blocksuicide) == 3) {
            
len += formatex(menu[len], charsmax(menu) - len"\d7. %L^n^n"id"MENU_SPECTATOR")
        }
    }
    else {
        
len += formatex(menu[len], charsmax(menu) - len"\d7. %L^n^n"id"MENU_SPECTATOR")
    } 
PHP Code:
case 6// Join Spectator
        
{
            
// Player alive?
            
if(g_isalive[id]) {
                
// Prevent abuse by non-admins if block suicide setting is enabled
                
if(get_pcvar_num(cvar_blocksuicide) && !(get_user_flags(id) & g_access_flag[ACCESS_ADMIN_MENU])) {
                    
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
                    
                    return 
PLUGIN_HANDLED;
                }
                
                
// Check that we still have both humans and zombies to keep the round going
                
check_round(id)
                
                
// Kill him before he switches team
                
dllfunc(DLLFunc_ClientKillid)
            }
                        
                        
code...

__________________

MarLeo94 is offline
CryWolf
Veteran Member
Join Date: Jul 2008
Location: Romania
Old 03-25-2015 , 01:45   Re: [ZP v4.3] Block suicide
Reply With Quote #2

Because ZP has already that function in-built, you can try setting this plugin above zombieplague40.amxx in plugins.ini but y can't for sure say that this will work.
__________________
I dont walk trough this world with fear in my heart.
www.dark-arena.com L4D, CS1.6, CZ Servers

Last edited by CryWolf; 03-25-2015 at 01:47.
CryWolf is offline
Send a message via MSN to CryWolf Send a message via Yahoo to CryWolf
MarLeo94
Junior Member
Join Date: Jul 2013
Location: Reino de Europa.
Old 03-25-2015 , 12:26   Re: [ZP v4.3] Block suicide
Reply With Quote #3

Quote:
Originally Posted by CryWolf View Post
Because ZP has already that function in-built, you can try setting this plugin above zombieplague40.amxx in plugins.ini but y can't for sure say that this will work.
I know this inside, I did in fact, I've replaced the default code that I put up on this thread.
__________________

MarLeo94 is offline
Reply


Thread Tools
Display Modes

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:06.


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