AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   2 Ham Sandwich Questions (https://forums.alliedmods.net/showthread.php?t=134734)

GXLZPGX 08-08-2010 03:24

2 Ham Sandwich Questions
 
PHP Code:

public eDeathiVictimiAttacker )
{
    if( 
iVictim == iAttacker )
    {
        if( 
cs_get_user_team(iVictim) == CS_TEAM_T )
        {
            
client_print_color0Red"^4[Jailbreak]^3 %s ^1committed suicide^4!" )
        }
        
        if( 
cs_get_user_team(iVictim) == CS_TEAM_CT )
        {
            if( 
gLastRequest == true )
            {
                
client_print_color0Blue"^4[Jailbreak] ^1Lol^4,^1 an officer got scared^4." )
                
client_print_color0Blue"^4[Jailbreak] ^1You lost^4 5 VCP^1 for commiting suicide^4." )
                
PlayerXP[iVictim] -= 5;
                
                return 
PLUGIN_HANDLED;
            }
            
            
client_print_color0Blue"^4[Jailbreak]^3 %s ^1committed suicide^4!" )
        }
        
        return 
PLUGIN_HANDLED;
    }
    
    if( 
gInLR[iVictim] == true )
    {
        if( 
cs_get_user_team(iAttacker) == CS_TEAM_T )
        {
            new 
szName[32];
            
get_user_nameiAttackerszName32 )
            
client_print_color0Red"^4[Prisoner]^3 %s ^1won the Last Request^4!"szName )
            
            
PlayerXP[iAttacker] += 10
            client_print_color
iAttackerBlue"^1You gained^4 10 VCP^1 for winning^4!" )
            
            
gInLR[iVictim] = false;
            
gInLR[iAttacker] = false;
            
gLastRequest false;
            
gShot4Shot false;
            
gShotDeagle[iAttacker] = false;
            
gShotDeagle[iVictim] = false;
            
gToss false;
            
            return 
PLUGIN_HANDLED;
        }
        
        if( 
cs_get_user_team(iAttacker) == CS_TEAM_CT )
        {
            new 
szName[32];
            
get_user_nameiAttackerszName32 )
            
client_print_color0Blue"^4[Guard]^3 %s ^1won the Last Request^4!"szName )
            
            
PlayerXP[iAttacker] += 10
            client_print_color
iAttackerBlue"^1You gained^4 10 VCP^1 for winning^4!" )
            
            
gShotDeagle[iAttacker] = false;
            
gInLR[iAttacker] = false;
            
gInLR[iVictim] = false;
            
gShotDeagle[iVictim] = false;
            
gIsRebel[iVictim] = false;
            
gLastRequest false;
            
gShot4Shot false;
            
gToss false;
            
            return 
PLUGIN_HANDLED;
        }
        
        return 
PLUGIN_HANDLED;
    }
    
    if( 
cs_get_user_team(iVictim) == CS_TEAM_CT )
    {
        if( 
cs_get_user_team(iAttacker) == CS_TEAM_T )
        {
            
PlayerXP[iAttacker] += 5
            client_print_color
iAttackerBlue"^1You gained^4 5 VCP^1!" )
            
            return 
PLUGIN_HANDLED;
        }
        
        return 
PLUGIN_HANDLED;
    }
    
    if( 
cs_get_user_team(iVictim) == CS_TEAM_T )
    {
        
gIsRebel[iVictim] = false;
        
        if( 
cs_get_user_team(iAttacker) == CS_TEAM_CT )
        {
            
PlayerXP[iAttacker] += 5;
            
client_print_coloriAttackerBlue"^1You gained^4 5 VCP^1!" )
            
            return 
PLUGIN_HANDLED;
        }
        
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_HANDLED;


#1: Is it a bad habit to be using PLUGIN_HANDLED inside of Ham_Killed functions?
#2: Is it possible that using PLUGIN_HANDLED; inside of Ham_Killed functions can block death messages that appear top right?

Also, if using PLUGIN_HANDLED is a bad habit, should I use HAM_HANDLED instead? Or HAM_IGNORED;

ot_207 08-08-2010 04:10

Re: 2 Ham Sandwich Questions
 
#1 Yes! Because PLUGIN_HANDLED is just like HAM_IGNORED
#2 No. Will not help with anything. You need to block the message via register_message.


All times are GMT -4. The time now is 00:15.

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