Raised This Month: $95 Target: $400
 23% 

Bonus for spawn of player


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   General Purpose        Approver:   Emp` (115)
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 06-05-2009 , 07:14   Bonus for spawn of player
Reply With Quote #1

This plugin modify a little how much bonus health, armor and money you should start with.

Cvars:
  • bonus_health (Health on/off) < 1 | 0 >
  • bonus_healthamount (Amount of health) < 30 | * >
  • bonus_armor (Armor on/off) < 1 | 0 >
  • bonus_armoramount (Amount of armor) < 30 | * >
  • bonus_money (Money on/off) < 1 | 0 >
  • bonus_moneyamount (Amount of money) < 2000 | * >
  • bonus_enable (Enable plugin On/off) < 1 | 0 >
The first is default.
Attached Files
File Type: sma Get Plugin or Get Source (Bonus.sma - 1851 views - 1.3 KB)
__________________
I dislike this.

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

Last edited by TitANious; 06-05-2009 at 19:25.
TitANious is offline
Send a message via MSN to TitANious
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 06-05-2009 , 07:25   Re: Bonus for spawn of player
Reply With Quote #2

http://forums.alliedmods.net/showthread.php?p=702749
http://forums.alliedmods.net/showthread.php?t=90283
__________________
xPaw is offline
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 06-05-2009 , 07:26   Re: Bonus for spawn of player
Reply With Quote #3

Lol, the first, no it's not like a auto healer. What's the different from yours you think? With this you can get health and money from.
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
Anggara_nothing
Veteran Member
Join Date: Jan 2009
Location: Indonesia
Old 06-05-2009 , 07:31   Re: Bonus for spawn of player
Reply With Quote #4

Little different.
Anggara_nothing is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: Romania
Old 06-05-2009 , 07:35   Re: Bonus for spawn of player
Reply With Quote #5

PHP Code:
{
    if ( ( !
is_user_alive id ) ) && ( get_pcvar_num pCvarEnable ) == 0))
        return 
HAM_SUPERCEDE;
        
    if ( ( 
get_pcvar_num pCvarEnable ) ==) )
        { 
wtf?
__________________
All my lifetime work is there (includin private big ass plugins and stuff) https://github.com/tutyamxx

tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-05-2009 , 07:36   Re: Bonus for spawn of player
Reply With Quote #6

You add really unecessary code, I would do something like :

Code:
public fwHamPlayerSpawnPost ( id ) {     if ( is_user_alive( id ) && get_pcvar_num ( pCvarEnable ) )     {         if ( get_pcvar_num ( pCvarHealth ) )         {             //         }                 if ( get_pcvar_num ( pCvarArmor ) )         {             //         }                 if ( get_pcvar_num ( pCvarMoney ) )         {             //         }     } }

Also even it's not a big deal, you can avoid to create var.
__________________
Arkshine is offline
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 06-05-2009 , 07:46   Re: Bonus for spawn of player
Reply With Quote #7

Quote:
Originally Posted by tuty View Post
PHP Code:
{
    if ( ( !
is_user_alive id ) ) && ( get_pcvar_num pCvarEnable ) == 0))
        return 
HAM_SUPERCEDE;
        
    if ( ( 
get_pcvar_num pCvarEnable ) ==) )
        { 
wtf?
The compiler didn't caught it Thanks.
Arkshine, i've done what you said (Or i hope it was that )
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 06-05-2009 , 07:51   Re: Bonus for spawn of player
Reply With Quote #8

It didnt caught it to make fun of you at forums.
__________________
xPaw is offline
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 06-05-2009 , 08:59   Re: Bonus for spawn of player
Reply With Quote #9

Lol, you are just trying to joke with everybody on this forum, which have less experience in amxx coding than you?
__________________
I dislike this.

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

Last edited by TitANious; 06-05-2009 at 09:43.
TitANious is offline
Send a message via MSN to TitANious
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-05-2009 , 13:03   Re: Bonus for spawn of player
Reply With Quote #10

Don't return something, no need. Also it should be HAM_IGNORED but by default it returns that so no need to add it.

About the vars you create, it's not needed. Include directly, example : set_user_health ( id, get_user_health( id ) + get_pcvar_num( pCvarHealthAmount ) );
__________________
Arkshine is offline
Reply


Thread Tools
Display Modes

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 01:59.


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