Quote:
Originally Posted by Debesėlis
How do you make the maximum allowed cash 16,000 because now it gives up to 18,000 and then subtracts to 16,000 in the next round.
|
PHP Code:
new amx_money_num_pointer
public plugin_init()
{
amx_money_num_pointer = register_cvar("amx_money_num", "5000")
}
give_money(id)
{
new iMoneyToGive = get_pcvar_num(amx_money_num_pointer)
new iPlayerMoney = cs_get_user_money(id)
iMoneyToGive = min(16000 - iPlayerMoney, iMoneyToGive)
iPlayerMoney += iMoneyToGive
cs_set_user_money(id, iPlayerMoney)
client_print(id, print_chat, "%L", LANG_PLAYER, "MONEY", iMoneyToGive)
Less details :
PHP Code:
give_money(id)
{
new iPlayerMoney = cs_get_user_money(id)
new iMoneyToGive = min(16000 - iPlayerMoney, get_pcvar_num(amx_money_num_pointer))
cs_set_user_money(id, iPlayerMoney + iMoneyToGive)
client_print(id, print_chat, "%L", LANG_PLAYER, "MONEY", iMoneyToGive)
__________________