AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [REQ] limit max money below $16000 (https://forums.alliedmods.net/showthread.php?t=186410)

csykosoma 05-29-2012 19:52

[REQ] limit max money below $16000
 
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 !

akcaliberg 05-29-2012 20:08

Re: [REQ] limit max money below $16000
 
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 ?

csykosoma 05-29-2012 20:39

Re: [REQ] limit max money below $16000
 
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

NucL3ra 05-30-2012 01:08

Re: [REQ] limit max money below $16000
 
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))



ConnorMcLeod 05-30-2012 01:59

Re: [REQ] limit max money below $16000
 
Quote:

Originally Posted by NucL3ra (Post 1719179)
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)
            }
        }
    }



EpicMonkey 05-30-2012 02:07

Re: [REQ] limit max money below $16000
 
Quote:

Originally Posted by NucL3ra (Post 1719179)
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 ....

NucL3ra 05-30-2012 02:42

Re: [REQ] limit max money below $16000
 
Whatevs...

__ It was 7 AM __

EpicMonkey 05-30-2012 03:05

Re: [REQ] limit max money below $16000
 
Quote:

Originally Posted by ConnorMcLeod (Post 1719194)
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?

ConnorMcLeod 05-30-2012 12:56

Re: [REQ] limit max money below $16000
 
Quote:

Originally Posted by EpicMonkey (Post 1719215)
when a player connects to the server after the round has started?

mp_startmoney :mrgreen:

EpicMonkey 05-30-2012 15:12

Re: [REQ] limit max money below $16000
 
Quote:

Originally Posted by ConnorMcLeod (Post 1719503)
mp_startmoney :mrgreen:

i see :3


All times are GMT -4. The time now is 00:26.

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