Raised This Month: $ Target: $400
 0% 

Problem with Ham_playerkilled_post


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Moody92
Veteran Member
Join Date: May 2011
Location: Oman
Old 04-19-2012 , 09:59   Problem with Ham_playerkilled_post
Reply With Quote #1

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 ?

Last edited by Moody92; 04-19-2012 at 11:13.
Moody92 is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-19-2012 , 10:37   Re: Problem with Ham_playerkilled_post
Reply With Quote #2

You forgot a } at the end of function Ham_PlayerSpawn_Post
__________________

Last edited by Napoleon_be; 04-19-2012 at 10:38.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Moody92
Veteran Member
Join Date: May 2011
Location: Oman
Old 04-19-2012 , 10:52   Re: Problem with Ham_playerkilled_post
Reply With Quote #3

let me check.

Same with more errors

Last edited by Moody92; 04-19-2012 at 11:04.
Moody92 is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-19-2012 , 10:56   Re: Problem with Ham_playerkilled_post
Reply With Quote #4

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>
__________________

Last edited by Napoleon_be; 04-19-2012 at 10:56.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Moody92
Veteran Member
Join Date: May 2011
Location: Oman
Old 04-19-2012 , 11:14   Re: Problem with Ham_playerkilled_post
Reply With Quote #5

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.
Moody92 is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 04-19-2012 , 11:23   Re: Problem with Ham_playerkilled_post
Reply With Quote #6

Quote:
Originally Posted by Napoleon_be View Post
You forgot a } at the end of function Ham_PlayerSpawn_Post
...

Also, indent your code.. that would be better to see errors.
__________________
You can do anything you set your mind to, man.

Devil259 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-19-2012 , 11:28   Re: Problem with Ham_playerkilled_post
Reply With Quote #7

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 );  
            } 
        } 
    } 
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply



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 07:46.


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