I'm quiet new to amxmodx scripting, but i have experience with programming.
money.
But the thing is.. its only showing it for the first player, like i'm player 1 in the players[32] array and after the loop it stops.
My question is, could a exp amxmodx scripter take a look into my code to see if i've done something wrong?
Code:
<font face="monospace">#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <engine>
#include <cstrike>
#define PLUGIN "simple wartool"
#define AUTHOR "havox"
#define VERSION "0.1 beta"
new players[11], num
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say_team money", "give_user_money", 0, "- displays money")
}
public give_user_money() {
get_players(players, num)
new i
for(i=0;i<num;i++)
{
if(get_user_team(players[i]) == 1)
{
new y
new Float:height = 0.35
for(y=0;y<num;y++)
{
if(get_user_team(players[y]) == 1)
{
new moneyData = cs_get_user_money(players[y])
new playersName[18]
get_user_name(players[y], playersName, 17)
set_hudmessage(255, 255, 0, -2.0, height, 0, 0.0, 8.0, 0.1, 0.1, 1)
show_hudmessage(players[i], "%s has: %i ", playersName, moneyData)
height -= 0.10
}
}
}
else
{
new y
new Float:height = 0.35
for(y = 0; y < num; y++)
{
if(get_user_team(players[y]) == 2)
{
new moneyData = cs_get_user_money(players[y])
new playersName[18]
get_user_name(players[y], playersName, 17)
set_hudmessage(255, 255, 0, -2.0, height, 0, 0.0, 8.0, 0.1, 0.1, 1)
show_hudmessage(players[i], "%s has: %i ", playersName, moneyData)
height -= 0.10
}
}
}
}
return PLUGIN_HANDLED
}
</font>