Dudes, I'm trying to pick the money spent from a player.
Thats the code:
PHP Code:
new MoneySpent[33]
public plugin_init()
{
register_message(get_user_msgid("Money"), "Message_Money")
}
public Message_Money(iMsgId, iMsgDest, id)
{
new iMsgArgInt = get_msg_arg_int(1)
new PlayerMoneySpent = (DefaultMoneyStart - iMsgArgInt)
MoneySpent[id] = PlayerMoneySpent
new userName[32]
get_user_name(id, userName, 31)
console_print(0,"Player Spenting: %s, Money Spent: %d",userName, PlayerMoneySpent)
}
But it returns the money adding up the equipment you own, not the money spent at the beginning of the round.
Output in the first round:
Code:
Player spenting: EFFx, Money spent: 7975 ( AWP+FULL AMMO, DEAGLE+FULL AMMO, VESTHELM AND ALL GRENADES
But when the round ends and start again, appear 7675 in the console, because I threw a HE Grenade. And if I don't threw any grenade and buy an AK in the round, it shows 14075.
What I want know is any other method to return the money spent at the beginning of the round.
And ahh, i'm reseting it with Ham_Spawn and it doesn't fix the issue.
__________________