Raised This Month: $32 Target: $400
 8% 

Roundmoney


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 04-08-2012 , 07:24   Roundmoney
Reply With Quote #1

I need plugin that gives exact the same amount of money each round, because now it is like, when team wins it gets more money than the one which loses. I have found similar plugin in sourcemod: http://forums.alliedmods.net/showthread.php?p=906577 Plugin basicly should remove original give money and add money by given cvar.
GuskiS is offline
COre^
Member
Join Date: Dec 2008
Old 04-08-2012 , 13:03   Re: Roundmoney
Reply With Quote #2

Hope is what you need, if not tell me. UNSTESTED

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>

#define PLUGIN "Plugin Name"
#define VERSION "1.0"
#define AUTHOR "AntiChupines"

#define IsValidTeam(%1)    (CS_TEAM_T <= cs_get_user_team(%1) <= CS_TEAM_CT)

new g_Moneyg_mAmount

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
g_Money register_cvar("amx_money""0")
    
g_mAmount register_cvar("amx_money_amount""800")
    
    
RegisterHam(Ham_Spawn,"player","HamSpawnPlayer",1)
    
}

public 
HamSpawnPlayer(id)
{
    new 
money get_pcvar_num(g_mAmount)
    
    if (
is_user_connected(id) || is_user_alive(id) && IsValidTeam(id))
    {
        
        if(!
get_pcvar_num(g_Money)) 
        return 
PLUGIN_HANDLED
        
        cs_set_user_money
(idmoney)
    }
    
    return 
PLUGIN_HANDLED

COre^ is offline
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 04-08-2012 , 14:06   Re: Roundmoney
Reply With Quote #3

Nope, thats not what I want. This plugin states the money amount to that 800, for example. But I want it to add that 800 every round to both teams, cause when one team wins it gets 3000 for example, loser team 1500. But I want that both teams get 2500 everyround.
GuskiS is offline
COre^
Member
Join Date: Dec 2008
Old 04-08-2012 , 14:54   Re: Roundmoney
Reply With Quote #4

PHP Code:
/* Plugin generated by AMXX-Studio */ 

#include <amxmodx> 
#include <amxmisc> 
#include <cstrike> 

#define PLUGIN "Plugin Name" 
#define VERSION "1.0" 
#define AUTHOR "AntiChupines" 

#define IsValidTeam(%1)    (CS_TEAM_T <= cs_get_user_team(%1) <= CS_TEAM_CT) 

new g_Moneyg_mAmount 

public plugin_init() { 
    
register_plugin(PLUGINVERSIONAUTHOR
     
    
g_Money register_cvar("amx_money""0"
    
g_mAmount register_cvar("amx_money_amount""800"
     
    
register_event("HLTV""Event_RoundStart""a""1=0""2=0")
     


public 
Event_RoundStart(id
{
    if(!
get_pcvar_num(g_Money))
    return 
PLUGIN_HANDLED
        
    
new money get_pcvar_num(g_mAmount)
    new const 
prev_money cs_get_user_money(id)
        
    if(
is_user_alive(id) && IsValidTeam(id))
    {
        
cs_set_user_money(id, (prev_money money))

    }
    
    return 
PLUGIN_HANDLED

COre^ is offline
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 04-08-2012 , 16:27   Re: Roundmoney
Reply With Quote #5

Code:
L 04/08/2012 - 23:26:16: [CSTRIKE] Player out of range (0)
L 04/08/2012 - 23:26:16: [AMXX] Displaying debug trace (plugin "roundmoney.amxx")
L 04/08/2012 - 23:26:16: [AMXX] Run time error 10: native error (native "cs_get_user_money")
L 04/08/2012 - 23:26:16: [AMXX]    [0] roundmoney.sma::Event_RoundStart (line
Not working. Also, I'm using it with biohazard plugin.

Last edited by GuskiS; 04-08-2012 at 16:27.
GuskiS 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 09:48.


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