AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [REQUEST] CS:S money methods (https://forums.alliedmods.net/showthread.php?t=56570)

ferret 06-16-2007 11:23

[REQUEST] CS:S money methods
 
Looking for a way to get and set player's money in CS:S. If this could be done with a little word through the core SM, great, if not, let me know what can help me accomplish this.

I basicly just need the equivolents of cs_get_player_money(id) and cs_set_player_money(id, amount)

Knagg0 06-16-2007 11:29

Re: [REQUEST] CS:S money methods
 
Code:

new g_iAccount = -1;

public OnPluginStart()
{
        g_iAccount = FindSendPropOffs("CCSPlayer", "m_iAccount");
}

public SetMoney(client, amount)
{
        if(g_iAccount != -1)
                SetEntData(client, g_iAccount, amount);
}

public GetMoney(client)
{
        if(g_iAccount != -1)
                return GetEntData(client, g_iAccount);

        return 0;
}


ferret 06-16-2007 13:25

Re: [REQUEST] CS:S money methods
 
Much love

zogi79 06-22-2007 08:37

Re: [REQUEST] CS:S money methods
 
How would the code look like to create a new admin command called sm_cash that would give all players in all teams 16000 money?
I had such command in mani and it was very usefull for warmup before pcws.

ferret 06-26-2007 10:07

Re: [REQUEST] CS:S money methods
 
http://forums.alliedmods.net/showthr...902#post494902


All times are GMT -4. The time now is 17:03.

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