Raised This Month: $ Target: $400
 0% 

[Addon] Monster XP


Post New Thread Reply   
 
Thread Tools Display Modes
MatheusMARAN
Junior Member
Join Date: Apr 2010
Location: Paraná, BR
Old 03-28-2011 , 04:13   Re: [Addon] Monster XP
Reply With Quote #31

PHP Code:
    if ( equal(monsterModel"models/agrunt.mdl") ) {
            
monsterName "Alien Grunt"
            
xp get_pcvar_num(AgrXP)
        }
        else if ( 
equal(monsterModel"models/apache.mdl") ) {
            
monsterName "Apache"
            
xp get_pcvar_num(ApaXP)
        }
        else if ( 
equal(monsterModel"models/barney.mdl") ) {
            
monsterName "Barney"
            
xp get_pcvar_num(BarXP)
        }
        else if ( 
equal(monsterModel"models/big_mom.mdl") ) {
            
monsterName "Big Momma"
            
xp get_pcvar_num(BigXP)
        }
        else if ( 
equal(monsterModel"models/bullsquid.mdl") ) {
            
monsterName "Bull Squid"
            
xp get_pcvar_num(BulXP)
        }
        else if ( 
equal(monsterModel"models/controller.mdl") ) {
            
monsterName "Controller"
            
xp get_pcvar_num(ConXP)
        }
        else if ( 
equal(monsterModel"models/garg.mdl") ) {
            
monsterName "Gargantua"
            
xp get_pcvar_num(GarXP)
        }
        else if ( 
equal(monsterModel"models/headcrab.mdl") ) {
            
monsterName "Head Crab"
            
xp get_pcvar_num(HeaXP)
        }
        else if ( 
equal(monsterModel"models/houndeye.mdl") ) {
            
monsterName "Hound Eye"
            
xp get_pcvar_num(HouXP)
        }
        else if ( 
equal(monsterModel"models/hassassin.mdl") ) {
            
monsterName "Human Assassin"
            
xp get_pcvar_num(HasXP)
        }
        else if ( 
equal(monsterModel"models/hgrunt.mdl") ) {
            
monsterName "Human Grunt"
            
xp get_pcvar_num(HgrXP)
        }
        else if ( 
equal(monsterModel"models/scientist.mdl") ) {
            
monsterName "Scientist"
            
xp get_pcvar_num(SciXP)
        }
        else if ( 
equal(monsterModel"models/islave.mdl") ) {
            
monsterName "Slave"
            
xp get_pcvar_num(IslXP)
        }
        else if ( 
equal(monsterModel"models/w_squeak.mdl") ) {
            
monsterName "Snark"
            
xp get_pcvar_num(SnaXP)
        }
        else if ( 
equal(monsterModel"models/zombie.mdl") ) {
            
monsterName "Zombie"
            
xp get_pcvar_num(ZomXP)
        }
        else {
            return
        } 
Replace it with:
PHP Code:
        switch ( monsterModel ) {
            case 
"models/agrunt.mdl": {
                
monsterName "Alien Grunt"
                
xp get_pcvar_num(AgrXP)
            }
            case 
"models/apache.mdl": {
                
monsterName "Apache"
                
xp get_pcvar_num(ApaXP)
            }
            case 
"models/barney.mdl": {
                
monsterName "Barney"
                
xp get_pcvar_num(BarXP)
            }
            case 
"models/big_mom.mdl": {
                
monsterName "Big Momma"
                
xp get_pcvar_num(BigXP)
            }
            case 
"models/bullsquid.mdl": {
                
monsterName "Bull Squid"
                
xp get_pcvar_num(BulXP)
            }
            case 
"models/controller.mdl": {
                
monsterName "Controller"
                
xp get_pcvar_num(ConXP)
            }
            case 
"models/garg.mdl": {
                
monsterName "Gargantua"
                
xp get_pcvar_num(GarXP)
            }
            case 
"models/headcrab.mdl": {
                
monsterName "Head Crab"
                
xp get_pcvar_num(HeaXP)
            }
            case 
"models/houndeye.mdl": {
                
monsterName "Hound Eye"
                
xp get_pcvar_num(HouXP)
            }
            case 
"models/hassassin.mdl": {
                
monsterName "Human Assassin"
                
xp get_pcvar_num(HasXP)
            }
            case 
"models/hgrunt.mdl": {
                
monsterName "Human Grunt"
                
xp get_pcvar_num(HgrXP)
            }
            case 
"models/scientist.mdl": {
                
monsterName "Scientist"
                
xp get_pcvar_num(SciXP)
            }
            case 
"models/islave.mdl": {
                
monsterName "Slave"
                
xp get_pcvar_num(IslXP)
            }
            case 
"models/w_squeak.mdl": {
                
monsterName "Snark"
                
xp get_pcvar_num(SnaXP)
            }
            case 
"models/zombie.mdl": {
                
monsterName "Zombie"
                
xp get_pcvar_num(ZomXP)
            }
            default: { return }
        } 
That code runs faster and is cleaner as well.
__________________
Kewl sign goes here
MatheusMARAN is offline
Send a message via MSN to MatheusMARAN
G-Dog
Senior Member
Join Date: Dec 2005
Location: Thunderstorm Central
Old 03-28-2011 , 08:54   Re: [Addon] Monster XP
Reply With Quote #32

Quote:
Originally Posted by MatheusMARAN View Post
PHP Code:
        switch ( monsterModel ) {
            case 
"models/agrunt.mdl": {
                
monsterName "Alien Grunt"
                
xp get_pcvar_num(AgrXP)
            }
            case 
"models/apache.mdl": {
                
monsterName "Apache"
                
xp get_pcvar_num(ApaXP)
            }
            case 
"models/barney.mdl": {
                
monsterName "Barney"
                
xp get_pcvar_num(BarXP)
            }
            case 
"models/big_mom.mdl": {
                
monsterName "Big Momma"
                
xp get_pcvar_num(BigXP)
            }
            case 
"models/bullsquid.mdl": {
                
monsterName "Bull Squid"
                
xp get_pcvar_num(BulXP)
            }
            case 
"models/controller.mdl": {
                
monsterName "Controller"
                
xp get_pcvar_num(ConXP)
            }
            case 
"models/garg.mdl": {
                
monsterName "Gargantua"
                
xp get_pcvar_num(GarXP)
            }
            case 
"models/headcrab.mdl": {
                
monsterName "Head Crab"
                
xp get_pcvar_num(HeaXP)
            }
            case 
"models/houndeye.mdl": {
                
monsterName "Hound Eye"
                
xp get_pcvar_num(HouXP)
            }
            case 
"models/hassassin.mdl": {
                
monsterName "Human Assassin"
                
xp get_pcvar_num(HasXP)
            }
            case 
"models/hgrunt.mdl": {
                
monsterName "Human Grunt"
                
xp get_pcvar_num(HgrXP)
            }
            case 
"models/scientist.mdl": {
                
monsterName "Scientist"
                
xp get_pcvar_num(SciXP)
            }
            case 
"models/islave.mdl": {
                
monsterName "Slave"
                
xp get_pcvar_num(IslXP)
            }
            case 
"models/w_squeak.mdl": {
                
monsterName "Snark"
                
xp get_pcvar_num(SnaXP)
            }
            case 
"models/zombie.mdl": {
                
monsterName "Zombie"
                
xp get_pcvar_num(ZomXP)
            }
            default: { return }
        } 
That code runs faster and is cleaner as well.
can't use an array in a switch statement, so your faster code doesn't work at all. If you wanted to use a switch statement you would have to check individual characters like so
PHP Code:
        switch(monsterModel[7])
        {
            case 
'a': {
                switch(
monsterModel[8])
                {
                    case 
'g': {
                        
monsterName "Alien Grunt"
                        
xp get_pcvar_num(AgrXP
                    }
                    case 
'p': {
                        
monsterName "Apache"
                        
xp get_pcvar_num(ApaXP)
                    }
                    default: return;
                }
            }
            case 
'b': {
                switch(
monsterModel[8])
                {
                    case 
'a': {
                        
monsterName "Barney"
                        
xp get_pcvar_num(BarXP)
                    }
                    case 
'i': {
                        
monsterName "Big Momma"
                        
xp get_pcvar_num(BigXP)
                    }
                    case 
'u': {
                        
monsterName "Bull Squid"
                        
xp get_pcvar_num(BulXP)
                    }
                    default: return;
                }
            }
            case 
'c': {
                
monsterName "Controller"
                
xp get_pcvar_num(ConXP)
            }
            case 
'g': {
                
monsterName "Gargantua"
                
xp get_pcvar_num(GarXP)
            }
            case 
'h': {
                switch(
monsterModel[8])
                {
                    case 
'a': {
                        
monsterName "Human Assassin"
                        
xp get_pcvar_num(HasXP)
                    }
                    case 
'e': {
                        
monsterName "Head Crab"
                        
xp get_pcvar_num(HeaXP)
                    }
                    case 
'g': {
                        
monsterName "Human Grunt"
                        
xp get_pcvar_num(HgrXP)
                    }
                    case 
'o': {
                        
monsterName "Hound Eye"
                        
xp get_pcvar_num(HouXP)
                    }
                    default: return;
                }
            }
            case 
'i': {
                
monsterName "Slave"
                
xp get_pcvar_num(IslXP)
            }
            case 
's': {
                
monsterName "Scientist"
                
xp get_pcvar_num(SciXP)
            }
            case 
'w': {
                
monsterName "Snark"
                
xp get_pcvar_num(SnaXP)
            }
            case 
'z': {
                
monsterName "Zombie"
                
xp get_pcvar_num(ZomXP)
            }
            default: return;
        } 
__________________
If at first you don't succeed, then skydiving isn't for you.
G-Dog is offline
Send a message via AIM to G-Dog
MatheusMARAN
Junior Member
Join Date: Apr 2010
Location: Paraná, BR
Old 03-30-2011 , 17:36   Re: [Addon] Monster XP
Reply With Quote #33

Quote:
Originally Posted by G-Dog View Post
can't use an array in a switch statement, so your faster code doesn't work at all. If you wanted to use a switch statement you would have to check individual characters like so
Thanks for pointing it out. Well, actually it's C# syntax so I tought it'd work with Pawn as well.
__________________
Kewl sign goes here
MatheusMARAN is offline
Send a message via MSN to MatheusMARAN
Intex
Junior Member
Join Date: Jun 2011
Old 06-13-2011 , 13:42   Re: [Addon] Monster XP
Reply With Quote #34

Hello

Who help me install this plugin, on my server? ;/
Intex is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 06-13-2011 , 13:49   Re: [Addon] Monster XP
Reply With Quote #35

This is
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 06-13-2011 , 18:40   Re: [Addon] Monster XP
Reply With Quote #36

plugins-shero.ini
Load it after the core plugin. (like an hero)

Last edited by Fr33m@n; 06-13-2011 at 18:43.
Fr33m@n is offline
Intex
Junior Member
Join Date: Jun 2011
Old 06-14-2011 , 14:18   Re: [Addon] Monster XP
Reply With Quote #37

If I install Monster Mod, Super Hero mod is offline ;/


And have a question. Am i must installing plugin Monster MOD?

How I add the monster on the map?

It works in the new version of super hero mod?

Last edited by Intex; 06-14-2011 at 14:34.
Intex is offline
ShiiTake
Member
Join Date: May 2010
Old 01-21-2012 , 04:59   Re: [Addon] Monster XP
Reply With Quote #38

I tried to install on my server did not work.

I installed the files in the folders correctly.


Code:
Currently loaded plugins:
description stat pend file vers src load unlod
[ 1] AMX Mod X RUN - amxmodx_mm.dll v1.8.1.3 ini Start ANY
[ 2] Booster RUN - booster_mm.dll v2.31 ini Chlvl Pause
[ 3] Monster RUN - monster_mm.dll v3.02.01 ini Chlvl Chlvl
[ 4] Fun RUN - fun_amxx.dll v1.8.1.3 pl1 ANY ANY
[ 5] Engine RUN - engine_amxx.dll v1.8.1.3 pl1 ANY ANY
[ 6] FakeMeta RUN - fakemeta_amxx.dl v1.8.1.3 pl1 ANY ANY
[ 7] CStrike RUN - cstrike_amxx.dll v1.8.1.3 pl1 ANY ANY
[ 8] CSX RUN - csx_amxx.dll v1.8.1.3 pl1 ANY ANY
[ 9] Ham Sandwich RUN - hamsandwich_amxx v1.8.1.3 pl1 ANY ANY
9 plugins, 9 running
__________________
ShiiTake is offline
ShiiTake
Member
Join Date: May 2010
Old 05-13-2012 , 05:44   Re: [Addon] Monster XP
Reply With Quote #39

hello ???
__________________
ShiiTake is offline
yaser1984
Zero Posts
Join Date: May 2012
Old 05-18-2012 , 12:38   Re: [Addon] Monster XP
Reply With Quote #40

Great stuff. You guys are amazingly talented. Thanks for sharing.
__________________
yaser1984 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 04:19.


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