Hi...
Well, i don't understand how to do this.. i think is a rly easy and small code but i don't catch how to do it o.O
I need to get for EXAMPLE... the money of ALL players but not separated... so i want to show all the money in a hud...
PHP Code:
#include <amxmodx>
#include <cstrike>
#define PLUGIN "Get Money Test"
#define AUTHOR "Alucard"
#define VERSION "1.0"
new HudSync
new g_MaxPlayers
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
set_task(1.0, "ShowMoney", 0, "", 0, "b")
g_MaxPlayers = get_maxplayers()
HudSync = CreateHudSyncObj()
}
public ShowMoney()
{
new money, i
for(i = 0; i <= g_MaxPlayers; i++)
{
if(is_user_alive(i) )
money = cs_get_user_money(i)
}
set_hudmessage(255, 255, 255, 0.01, 0.15, 0, 1.0, 1.0, 0.1, 0.2, -1)
ShowSyncHudMsg(0, HudSync, "Money: %i", money)
}
This not work and i understand why is not working... is becouse the cs_get_user_money(i) doesn't get the total amount of all money.. just get the money for every index (i). Now i ask... how to get the total amount of money from all players.
Thx and sry if my english suck.
__________________