依连输场次补助现金
按照连输的场次 , 给予一定的补助金 (0, 1000, 2500, 3500, 4500, 5500)源码:
#include <amxmodx>
#include <cstrike>
#define AWARD_LEVELS 5
#define MAX_AWARD 9000
new const award[] = {0, 1000, 2500, 3500, 4500, 5500}
new score[] = {0, 0}
new scale = 0
public teamscore()
{
new team
read_data(1,team,1)
new curTeam = (team == 'C') ? 0 : 1
new curScore = read_data(2)
if (curScore == score)
return PLUGIN_CONTINUE
score = curScore
// Keep a sliding scale of losses clamped to 7
// Scale is positive when CT's are winning
if (curTeam)
{
scale += 1
} else
{
scale -= 1
}
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
if (!pot)
return PLUGIN_CONTINUE
new players;
new playerCount, i
get_players(players, playerCount, "ce", curTeam ? "CT" : "TERRORIST")
for (i=0;i < playerCount; i++)
{
new money = cs_get_user_money(players)
new newmoney = max(clamp(money+pot, 0, MAX_AWARD), money) // Only give extra money up to 8000
cs_set_user_money(players, newmoney, 1)
}
return PLUGIN_CONTINUE
}
public plugin_init()
{
register_plugin("JETB", "0.5", "Janzert")
register_cvar("extramoney", "1")
register_event("TeamScore", "teamscore", "a");
return PLUGIN_CONTINUE
} sofa~ No.1!{:3_53:} 好像有人发过了 好像有人发过了
baiduqq1314 发表于 2010-6-24 00:49 http://www.dt-club.net/forum/images/common/back.gif
{:3_55:} 不是吧。。。。那我就再发点别的 ...郁闷的.. “高...实在是高" 伪军司令与鬼子的对话 嗯,好东西,收下了。 这个插件真好呀 晕到!!!这插件怎么用!!!!!
页:
[1]