Raised This Month: $ Target: $400
 0% 

the most noob question EVER MADE


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 06-06-2009 , 16:42   Re: the most noob question EVER MADE
Reply With Quote #9

I'm give an example.
PHP Code:
#include <amxmodx>
#include <cstrike> 
#include <hamsandwich>
#include <fun>

// #define Rockie
#define Hillarious

new pCvarEnablepCvarHealthpCvarHealthAmountpCvarArmorpCvarArmorAmountpCvarMoneypCvarMoneyAmount;

public 
plugin_init() 
{
    
register_plugin ("Bonus""1.0""TitANious")
    
    
#if defined Rockie
    
pCvarEnable register_cvar "bonus_enable""1" )                                    
    
pCvarHealth register_cvar "bonus_health""1" )     
    
pCvarHealthAmount register_cvar "bonus_healthamount""30" )                      
    
pCvarArmor register_cvar "bonus_armor""1" )       
    
pCvarArmorAmount register_cvar "bonus_armoramount""30" )               
    
pCvarMoney register_cvar "bonus_money""1" )
    
pCvarMoneyAmount register_cvar "bonus_moneyamount""2000" )    
    
#endif
    
    
RegisterHam Ham_Spawn"player""fwHamPlayerSpawnPost")
}

#if defined Hillarious
public fwHamPlayerSpawnPost id 
{
    if ( ( 
get_pcvar_num pCvarEnable ) ) && ( is_user_alive(id) ) )
    {
        if ( 
get_pcvar_num pCvarHealth ) == )
        {
            
set_user_health idget_user_health id ) + get_pcvar_num pCvarHealthAmount )  )
        }
        if ( 
get_pcvar_num pCvarArmor ) == )
        {
            
set_user_armor idget_user_armor id ) + get_pcvar_num pCvarArmorAmount ) )
        }
        if ( 
get_pcvar_num pCvarMoney ) == )
        {
            
cs_set_user_money idcs_get_user_money id ) + get_pcvar_num pCvarMoneyAmount ) )
        }
    }
}
#endif 
Now the pcvars (That will make the plugin have warnings) don't work because Rockie ain't defined (I've commented it)
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.

Last edited by TitANious; 06-06-2009 at 17:43.
TitANious is offline
Send a message via MSN to TitANious
 



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 13:50.


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