Raised This Month: $ Target: $400
 0% 

[HLP] give money to player(s)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 06-24-2011 , 11:29   [HLP] give money to player(s)
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>


#define PLUGIN_NAME "Bomb Plant/Defuse Money Bonus"
#define PLUGIN_VERSION "1.1"
#define PLUGIN_AUTHOR "Locks"

new plantbonus
new boombonus
new defusebonus

public plugin_init()
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)
    
register_event("23","Event_TargetBombed","a","1=17","6=-105","7=17");
    
plantbonus register_cvar("amx_plant_bonus""100")
    
boombonus register_cvar("amx_boom_bonus""100")
    
defusebonus register_cvar("amx_defuse_bonus""200")
}

public 
bomb_planted(id)
{
  
    new 
players[32], num
    get_players
(playersnum)
    new 
player
    
new bonus get_pcvar_num(boombonus)
    for(new 
i;i<num;i++)
    {
        
player=players[i]
        new 
CsTeams:Team cs_get_user_team(player)
        if(
Team == CS_TEAM_T)
        
cs_set_user_money(playercs_get_user_money(player) + bonus)
    
    }
}

public 
Event_TargetBombed(id)
{
  
    new 
players[32], num
    get_players
(playersnum)
    new 
player
    
new bonus get_pcvar_num(plantbonus)
    for(new 
i;i<num;i++)
    {
        
player=players[i]
        new 
CsTeams:Team cs_get_user_team(player)
        if(
Team == CS_TEAM_T)
        
cs_set_user_money(playercs_get_user_money(player) + bonus)
    
    }
}

public 
bomb_defused()
{
  
    new 
players[32], num
    get_players
(playersnum)
    new 
player
    
new bonus get_pcvar_num(defusebonus)
    for(new 
i;i<num;i++)
    {
        
player=players[i]
        new 
CsTeams:Team cs_get_user_team(player)
        if(
Team == CS_TEAM_CT)
        
cs_set_user_money(playercs_get_user_money(player) + bonus)
    
    }

This plugin gives money for the bomb plant \ boom \ defuse events.
How to make money was given to all players in the team?
__________________
sorry my bad english...
alonelive is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-24-2011 , 16:14   Re: [HLP] give money to player(s)
Reply With Quote #2

Quote:
Originally Posted by alonelive View Post
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>


#define PLUGIN_NAME "Bomb Plant/Defuse Money Bonus"
#define PLUGIN_VERSION "1.1"
#define PLUGIN_AUTHOR "Locks"

new plantbonus
new boombonus
new defusebonus

public plugin_init()
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)
    
register_event("23","Event_TargetBombed","a","1=17","6=-105","7=17");
    
plantbonus register_cvar("amx_plant_bonus""100")
    
boombonus register_cvar("amx_boom_bonus""100")
    
defusebonus register_cvar("amx_defuse_bonus""200")
}

public 
bomb_planted(id)
{
  
    new 
players[32], num
    get_players
(playersnum)
    new 
player
    
new bonus get_pcvar_num(boombonus)
    for(new 
i;i<num;i++)
    {
        
player=players[i]
        new 
CsTeams:Team cs_get_user_team(player)
        if(
Team == CS_TEAM_T)
        
cs_set_user_money(playercs_get_user_money(player) + bonus)
    
    }
}

public 
Event_TargetBombed(id)
{
  
    new 
players[32], num
    get_players
(playersnum)
    new 
player
    
new bonus get_pcvar_num(plantbonus)
    for(new 
i;i<num;i++)
    {
        
player=players[i]
        new 
CsTeams:Team cs_get_user_team(player)
        if(
Team == CS_TEAM_T)
        
cs_set_user_money(playercs_get_user_money(player) + bonus)
    
    }
}

public 
bomb_defused()
{
  
    new 
players[32], num
    get_players
(playersnum)
    new 
player
    
new bonus get_pcvar_num(defusebonus)
    for(new 
i;i<num;i++)
    {
        
player=players[i]
        new 
CsTeams:Team cs_get_user_team(player)
        if(
Team == CS_TEAM_CT)
        
cs_set_user_money(playercs_get_user_money(player) + bonus)
    
    }

This plugin gives money for the bomb plant \ boom \ defuse events.
How to make money was given to all players in the team?
The code already does give money to the whole team. But, bomb_planted() and bomb_defused() are never executed.
__________________

Last edited by fysiks; 06-24-2011 at 16:18.
fysiks is online now
DjOptimuS
Senior Member
Join Date: Jan 2009
Old 06-25-2011 , 02:57   Re: [HLP] give money to player(s)
Reply With Quote #3

add

#include <csx>

and all should be fine
DjOptimuS is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-25-2011 , 03:20   Re: [HLP] give money to player(s)
Reply With Quote #4

Quote:
Originally Posted by DjOptimuS View Post
add

#include <csx>

and all should be fine
Oh, I never thought about them being forwards.
__________________
fysiks is online now
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 06-25-2011 , 03:43   Re: [HLP] give money to player(s)
Reply With Quote #5

and how do I "title" the blocks of plugin?

public
bomb_planted(id) ---> Event_B
ombPlanted(id) ?
__________________
sorry my bad english...
alonelive is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-25-2011 , 03:52   Re: [HLP] give money to player(s)
Reply With Quote #6

Quote:
Originally Posted by alonelive View Post
and how do I "title" the blocks of plugin?

public
bomb_planted(id) ---> Event_B
ombPlanted(id) ?
I didn't realize that those were forwards so you should only need to do what DjOptimuS told you.
__________________
fysiks is online now
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 23:23.


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