Raised This Month: $51 Target: $400
 12% 

[REQ] limit max money below $16000


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
csykosoma
Member
Join Date: Dec 2011
Old 05-29-2012 , 19:52   [REQ] limit max money below $16000
Reply With Quote #1

couldnt find a plugin that does this, i want all players every round to have $4500, no more no less. they cannot save money, and can only spend $4500 per round.

thanks !
csykosoma is offline
akcaliberg
Senior Member
Join Date: Nov 2011
Location: Istanbul
Old 05-29-2012 , 20:08   Re: [REQ] limit max money below $16000
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <cstrike>
new g_maxplayers;
public 
plugin_init() {
    
    
register_logevent("start",2,"1=Round_Start")
    
g_maxplayers get_maxplayers()
}
public 
start() {
    for(new 
i=1g_maxplayers;i++) {
        
cs_set_user_money(i,4500)
    }

Do you want this ?
akcaliberg is offline
csykosoma
Member
Join Date: Dec 2011
Old 05-29-2012 , 20:39   Re: [REQ] limit max money below $16000
Reply With Quote #3

thanks, this has 1 problem, during freezetime players have the additional money. once freezetime ends, money is then set correctly to 4500.

so this only works if mp_freezetime 0

Last edited by csykosoma; 05-29-2012 at 20:39.
csykosoma is offline
NucL3ra
Veteran Member
Join Date: Sep 2008
Location: Bucuresti , Romania
Old 05-30-2012 , 01:08   Re: [REQ] limit max money below $16000
Reply With Quote #4

Use 'Player Spawn'

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

new SetMoney

public plugin_init() 
{
    
register_plugin("Set money""author""version")

    
SetMoney register_cvar("amx_setmoney""4500")

    
RegisterHam(Ham_Spawn"player""start"1)  

}
public 
start(id
{
        
cs_set_user_money(id,get_pcvar_num(SetMoney))

__________________
My nickname is nucLeaR, I just screwed up at registering and didn't want to change after that X_X.

Last edited by NucL3ra; 05-30-2012 at 03:56.
NucL3ra is offline
Send a message via Yahoo to NucL3ra
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-30-2012 , 01:59   Re: [REQ] limit max money below $16000
Reply With Quote #5

Quote:
Originally Posted by NucL3ra View Post
Use 'Player Spawn'

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

new SetMoney

public plugin_init() 
{
    
register_plugin("Set money""author""version")

    
SetMoney register_cvar("amx_setmoney""4500")

    
RegisterHam(Ham_Spawn"player""start"1)  

}
public 
start() 
{
    new 
Players[32], alivePlayers;
    
get_players(PlayersalivePlayers"ach")
    for(new 
i=0alivePlayersi++) 
    {
        
cs_set_user_money(Players[i],get_pcvar_num(SetMoney))
    }

Damn you are not serious !!!!! Can't believe you dared to release a big plugin such as ProKreedz...


About plugin, search in approved plugin, you can find one doing what you want.

EDIT : In fact it does not exactly what you want : http://forums.alliedmods.net/showthr...211#post743211 (even released one)

Try this then (use mp_startmoney cvar to set money):
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>

#define VERSION "0.0.1"
#define PLUGIN ""

new m_usResetDecalsg_iFwdPlaybackEventPmp_startmoney

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")

    
m_usResetDecals engfunc(EngFunc_PrecacheEvent1"events/decal_reset.sc")
    
mp_startmoney get_cvar_pointer("mp_startmoney")

    
register_event("HLTV""Event_HLTV_New_Round""a""1=0""2=0")
}

public 
Event_HLTV_New_Round()
{
    
g_iFwdPlaybackEventP register_forward(FM_PlaybackEvent"OnPlaybackEvent_Post"1)
}

public 
OnPlaybackEvent_Post(flagspInvokereventindex)
{
    if( 
eventindex == m_usResetDecals // couldn't be another one, but let's keep that check.
    
{
        
unregister_forward(FM_PlaybackEventg_iFwdPlaybackEventP1)
        new 
players[32], num
        get_players
(playersnum"ah")
        if( 
num )
        {
            new 
money get_pcvar_num(mp_startmoney)
            for(--
numnum>=0num--)
            {
                
cs_set_user_money(players[num], money)
            }
        }
    }

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 05-30-2012 at 02:11.
ConnorMcLeod is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 05-30-2012 , 02:07   Re: [REQ] limit max money below $16000
Reply With Quote #6

Quote:
Originally Posted by NucL3ra View Post
Use 'Player Spawn'

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

new SetMoney

public plugin_init() 
{
    
register_plugin("Set money""author""version")

    
SetMoney register_cvar("amx_setmoney""4500")

    
RegisterHam(Ham_Spawn"player""start"1)  

}
public 
start() 
{
    new 
Players[32], alivePlayers;
    
get_players(PlayersalivePlayers"ach")
    for(new 
i=0alivePlayersi++) 
    {
        
cs_set_user_money(Players[i],get_pcvar_num(SetMoney))
    }

This would give every player 4500 when a player spawns ... , why are you even using a loop there ....
EpicMonkey is offline
NucL3ra
Veteran Member
Join Date: Sep 2008
Location: Bucuresti , Romania
Old 05-30-2012 , 02:42   Re: [REQ] limit max money below $16000
Reply With Quote #7

Whatevs...

__ It was 7 AM __
__________________
My nickname is nucLeaR, I just screwed up at registering and didn't want to change after that X_X.

Last edited by NucL3ra; 05-30-2012 at 08:59.
NucL3ra is offline
Send a message via Yahoo to NucL3ra
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 05-30-2012 , 03:05   Re: [REQ] limit max money below $16000
Reply With Quote #8

Quote:
Originally Posted by ConnorMcLeod View Post
Damn you are not serious !!!!! Can't believe you dared to release a big plugin such as ProKreedz...


About plugin, search in approved plugin, you can find one doing what you want.

EDIT : In fact it does not exactly what you want : http://forums.alliedmods.net/showthr...211#post743211 (even released one)

Try this then (use mp_startmoney cvar to set money):
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>

#define VERSION "0.0.1"
#define PLUGIN ""

new m_usResetDecalsg_iFwdPlaybackEventPmp_startmoney

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")

    
m_usResetDecals engfunc(EngFunc_PrecacheEvent1"events/decal_reset.sc")
    
mp_startmoney get_cvar_pointer("mp_startmoney")

    
register_event("HLTV""Event_HLTV_New_Round""a""1=0""2=0")
}

public 
Event_HLTV_New_Round()
{
    
g_iFwdPlaybackEventP register_forward(FM_PlaybackEvent"OnPlaybackEvent_Post"1)
}

public 
OnPlaybackEvent_Post(flagspInvokereventindex)
{
    if( 
eventindex == m_usResetDecals // couldn't be another one, but let's keep that check.
    
{
        
unregister_forward(FM_PlaybackEventg_iFwdPlaybackEventP1)
        new 
players[32], num
        get_players
(playersnum"ah")
        if( 
num )
        {
            new 
money get_pcvar_num(mp_startmoney)
            for(--
numnum>=0num--)
            {
                
cs_set_user_money(players[num], money)
            }
        }
    }

when a player connects to the server after the round has started?
EpicMonkey is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-30-2012 , 12:56   Re: [REQ] limit max money below $16000
Reply With Quote #9

Quote:
Originally Posted by EpicMonkey View Post
when a player connects to the server after the round has started?
mp_startmoney
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 05-30-2012 , 15:12   Re: [REQ] limit max money below $16000
Reply With Quote #10

Quote:
Originally Posted by ConnorMcLeod View Post
mp_startmoney
i see
EpicMonkey 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 08:42.


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