AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problem with Ham_playerkilled_post (https://forums.alliedmods.net/showthread.php?t=183236)

Moody92 04-19-2012 09:59

Problem with Ham_playerkilled_post
 
Hello there i got this error while taking Change team code from nikhilgupta345 plugin

Quote:

Error: Invalid expression, assumed zero on line 52
Error: Undefined symbol "Ham_PlayerKilled_Post" on line 52
Error: Undefined symbol "iKiller" on line 52
Error: Too many error messages on one line on line 52

Compilation aborted.
4 Errors.
PHP Code:

/* Plugin generated by AMXX-Studio */ 

        #include < amxmodx > 
        #include < cstrike > 
        #include < hamsandwich > 
        #include < fun > 
        #include < fakemeta > 
        #include < engine > 
        #include < xs > 

        #define PLUGIN "test" 
        #define VERSION "1.0" 
        #define AUTHOR "nikhilgupta345" 
    
    
new const g_szPrefix[ ] = "[Nightcrawler]";
            
/* Booleans */ 
    
new bool:g_bNCNextRound33 ]; 

    public 
plugin_init() { 
    
register_plugin(PLUGINVERSIONAUTHOR
    
RegisterHamHam_Killed,         "player""Ham_PlayerKilled_Post",         ); 
    } 
     
        public 
client_putinserverid 
        { 
        
g_bNCNextRoundid ] = false
        }      
        public 
Ham_PlayerKilled_Post(iVictimiKilleriShouldGib
        { 
            if( !
is_user_aliveiKiller ) ) 
            return 
HAM_IGNORED

        switch( 
cs_get_user_teamiKiller ) )
        { 
            case 
CS_TEAM_CT
            { 
                if( 
cs_get_user_teamiVictim ) == CS_TEAM_T 
                { 
                    
client_printiVictimprint_chat"%s You were killed by a human and are now one also!"g_szPrefix ); 
                    
cs_set_user_teamiVictimCS_TEAM_CT ); 
                     
                    if( !
g_bNCNextRoundiKiller ] ) 
                    { 
                        
client_printiKillerprint_chat"%s You killed a Night-Crawler and will be one next round!"g_szPrefix ); 
                        
g_bNCNextRoundiKiller ] = true
                    } 
                } 
            } 
             
        case 
CS_TEAM_T
        { 
            if( 
cs_get_user_teamiVictim ) == CS_TEAM_CT )
        { 
                
client_printiKillerprint_chat"%s You killed a human!"g_szPrefix ); 
                
client_printiVictimprint_chat"%s You were killed by a Night-Crawler!"g_szPrefix ); 
        }
    }


Can anybody help ?

Napoleon_be 04-19-2012 10:37

Re: Problem with Ham_playerkilled_post
 
You forgot a } at the end of function Ham_PlayerSpawn_Post

Moody92 04-19-2012 10:52

Re: Problem with Ham_playerkilled_post
 
let me check.

Same with more errors

Napoleon_be 04-19-2012 10:56

Re: Problem with Ham_playerkilled_post
 
PHP Code:

public Ham_PlayerSpawn_Postid )
        {
        if( !
is_user_aliveid ) )
            return 
HAM_IGNORED;
        
        
strip_user_weaponsid );
        
give_itemid"weapon_knife" );
        
        new 
CsTeams:iTeam cs_get_user_teamid );
        
        if( 
g_bNCNextRoundid ] )
        {
            if( 
iTeam != CS_TEAM_T )
                {
            
cs_set_user_teamidCS_TEAM_T );
            
ExecuteHamBHam_CS_RoundRespawnid );
            
g_bNCNextRoundid ] = false;
            return 
HAM_IGNORED;
                }
            
            
g_bNCNextRoundid ] = false;
        } 

-->
PHP Code:

public Ham_PlayerSpawn_Postid )
        {
        if( !
is_user_aliveid ) )
            return 
HAM_IGNORED;
        
        
strip_user_weaponsid );
        
give_itemid"weapon_knife" );
        
        new 
CsTeams:iTeam cs_get_user_teamid );
        
        if( 
g_bNCNextRoundid ] )
        {
            if( 
iTeam != CS_TEAM_T )
                {
            
cs_set_user_teamidCS_TEAM_T );
            
ExecuteHamBHam_CS_RoundRespawnid );
            
g_bNCNextRoundid ] = false;
            return 
HAM_IGNORED;
                }
            
            
g_bNCNextRoundid ] = false;
        }


</b>

Moody92 04-19-2012 11:14

Re: Problem with Ham_playerkilled_post
 
There are more errors, I'll use a plugin for that HAM

Now the code is

PHP Code:

/* Plugin generated by AMXX-Studio */ 

        #include < amxmodx > 
        #include < cstrike > 
        #include < hamsandwich > 
        #include < fun > 
        #include < fakemeta > 
        #include < engine > 
        #include < xs > 

        #define PLUGIN "test" 
        #define VERSION "1.0" 
        #define AUTHOR "nikhilgupta345" 
    
    
new const g_szPrefix[ ] = "[Nightcrawler]";
            
/* Booleans */ 
    
new bool:g_bNCNextRound33 ]; 

    public 
plugin_init() { 
    
register_plugin(PLUGINVERSIONAUTHOR
    
RegisterHamHam_Killed,         "player""Ham_PlayerKilled_Post",         ); 
    } 
     
        public 
client_putinserverid 
        { 
        
g_bNCNextRoundid ] = false
        }      
        public 
Ham_PlayerKilled_Post(iVictimiKilleriShouldGib
        { 
            if( !
is_user_aliveiKiller ) ) 
            return 
HAM_IGNORED

        switch( 
cs_get_user_teamiKiller ) )
        { 
            case 
CS_TEAM_CT
            { 
                if( 
cs_get_user_teamiVictim ) == CS_TEAM_T 
                { 
                    
client_printiVictimprint_chat"%s You were killed by a human and are now one also!"g_szPrefix ); 
                    
cs_set_user_teamiVictimCS_TEAM_CT ); 
                     
                    if( !
g_bNCNextRoundiKiller ] ) 
                    { 
                        
client_printiKillerprint_chat"%s You killed a Night-Crawler and will be one next round!"g_szPrefix ); 
                        
g_bNCNextRoundiKiller ] = true
                    } 
                } 
            } 
             
        case 
CS_TEAM_T
        { 
            if( 
cs_get_user_teamiVictim ) == CS_TEAM_CT )
        { 
                
client_printiKillerprint_chat"%s You killed a human!"g_szPrefix ); 
                
client_printiVictimprint_chat"%s You were killed by a Night-Crawler!"g_szPrefix ); 
        }
    }


and the problem is
Quote:

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Warning: Loose indentation on line 33
Error: Expected token: "}", but found "-end of file-" on line 58

1 Error.

Devil259 04-19-2012 11:23

Re: Problem with Ham_playerkilled_post
 
Quote:

Originally Posted by Napoleon_be (Post 1692358)
You forgot a } at the end of function Ham_PlayerSpawn_Post

...

Also, indent your code.. that would be better to see errors.

Exolent[jNr] 04-19-2012 11:28

Re: Problem with Ham_playerkilled_post
 
If you would indent properly then you would see your mistake:
PHP Code:

/* Plugin generated by AMXX-Studio */  

#include < amxmodx >  
#include < cstrike >  
#include < hamsandwich >  
#include < fun >  
#include < fakemeta >  
#include < engine >  
#include < xs >  

#define PLUGIN "test"  
#define VERSION "1.0"  
#define AUTHOR "nikhilgupta345"  

new const g_szPrefix[ ] = "[Nightcrawler]"
/* Booleans */  
new bool:g_bNCNextRound33 ];  

public 
plugin_init() {  
    
register_plugin(PLUGINVERSIONAUTHOR)  
    
RegisterHamHam_Killed,         "player""Ham_PlayerKilled_Post",         );  
}  

public 
client_putinserverid )  
{  
    
g_bNCNextRoundid ] = false;  
}       
public 
Ham_PlayerKilled_Post(iVictimiKilleriShouldGib)  
{  
    if( !
is_user_aliveiKiller ) )  
        return 
HAM_IGNORED;  
    
    switch( 
cs_get_user_teamiKiller ) ) 
    {  
        case 
CS_TEAM_CT:  
        {  
            if( 
cs_get_user_teamiVictim ) == CS_TEAM_T )  
            {  
                
client_printiVictimprint_chat"%s You were killed by a human and are now one also!"g_szPrefix );  
                
cs_set_user_teamiVictimCS_TEAM_CT );  
                
                if( !
g_bNCNextRoundiKiller ] )  
                {  
                    
client_printiKillerprint_chat"%s You killed a Night-Crawler and will be one next round!"g_szPrefix );  
                    
g_bNCNextRoundiKiller ] = true;  
                }  
            }  
        }  
        
        case 
CS_TEAM_T:  
        {  
            if( 
cs_get_user_teamiVictim ) == CS_TEAM_CT 
            {  
                
client_printiKillerprint_chat"%s You killed a human!"g_szPrefix );  
                
client_printiVictimprint_chat"%s You were killed by a Night-Crawler!"g_szPrefix );  
            } 
        } 
    } 



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

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