|
scale = clamp(scale, 0-AWARD_LEVELS, AWARD_LEVELS)
log_message("「平安夜公告」 當前按物價計酬法 %d.", scale)
if (!get_cvar_num("extramoney"))
return PLUGIN_CONTINUE
// find the pot amount by converting the sliding scale to an index
// in the award lookup table
new pindex = scale
if (!curTeam)
pindex = 0-pindex
new pot = award[clamp(pindex-1, 0, 5)]
if (!pot)
return PLUGIN_CONTINUE
new players[32];
new playerCount, i
get_players(players, playerCount, "ce", curTeam ? "CT" : "TERRORIST")
for (i=0;i < playerCount; i++)
{
new money = cs_get_user_money(players[i])
new newmoney = max(clamp(money+pot, 0, MAX_AWARD), money) // Only give extra money up to 8000
cs_set_user_money(players[i], newmoney, 1)
|
|