Quote:
Originally Posted by Bugsy
Since cs_get_user_team() returns a CsTeams type, you need to define the iPTeam variable as CsTeams. You were also missing a closing bracket. Natsheh, you should avoid calling cs_get_user_team() multiple times for the same player.
I didn't look at your code beyond this, not sure if it does what you expect. Give it a try.
Code:
public updatePlayerEconomy()
{
new players[ 32 ] , playercount , player , player2 , szName[ 32 ]
new iPMoney , CsTeams:iPTeam[ 33 ];
get_players(players, playercount, "h");
for(new i ; i < playercount; i++)
{
player = players[i];
if ( !iPTeam[ player ] )
iPTeam[ player ] = cs_get_user_team( player );
if (CS_TEAM_T <= iPTeam[ player ] <= CS_TEAM_CT)
{
iPMoney = cs_get_user_money(player);
get_user_name(player, szName, charsmax(szName));
for ( new j = 0 ; j < playercount ; j++ )
{
player2 = players[j];
if ( !iPTeam[ player2 ] )
iPTeam[ player2 ] = cs_get_user_team( player2 );
if ( iPTeam[ player ] == iPTeam[ player2 ] )
{
client_print( player2 , print_chat , "%s => $%d" , szName , iPMoney );
}
}
}
}
}
|
Well actually i didnt really compiled the code neither tested it, it was written on a phone..
The code should function correctly.
Btw goldnux remove the bracket "{" after continue; and its close
__________________