|
楼主 |
发表于 2008-4-10 03:15:46
|
显示全部楼层
来自 中国–广西–柳州–柳北区
回复: 投票踢人修改版(投票必须2888元)[附源码]
鄙视一下下了就走人的,不想隐藏,自愿回复就回复吧。回冰河老兄,代码本来是想放在public checkVotes() {
new votesNum = g_voteCount[0] + g_voteCount[1]
new iRatio = votesNum ? floatround(g_voteRatio * float(votesNum), floatround_ceil) : 1
new iResult = g_voteCount[0]
new players[32], pnum, i
get_players(players, pnum, "c")
if (iResult < iRatio)
{
new lVotingFailed[64]
for (i = 0; i < pnum; i++)
{
format(lVotingFailed, 63, "%L", players, "VOTING_FAILED")
client_print(players, print_chat, "%L", players, "VOTING_RES_1", lVotingFailed, g_voteCount[0], g_voteCount[1], iRatio)
cs_set_user_money(data[0], cs_get_user_money(data[0])-2888)
}
format(lVotingFailed, 63, "%L", "en", "VOTING_FAILED")
log_amx("Vote: %s (got ^"%d^") (needed ^"%d^")", lVotingFailed, iResult, iRatio)
return PLUGIN_CONTINUE
}
if (g_execResult)
{
g_execResult = false
if (is_user_connected(g_voteCaller))
{
new menuBody[512], lTheResult[32], lYes[16], lNo[16]
format(lTheResult, 31, "%L", g_voteCaller, "THE_RESULT")
format(lYes, 15, "%L", g_voteCaller, "YES")
format(lNo, 15, "%L", g_voteCaller, "NO")
new len = format(menuBody, 511, g_coloredMenus ? "\y%s^n \w%s^n^n" : "%s^n %s^n^n", lTheResult, g_Answer)
len += format(menuBody[len], 511 - len, g_coloredMenus ? "\y%L^n\w" : "%L^n", g_voteCaller, "WANT_CONTINUE")
format(menuBody[len], 511 - len, "^n1. %s^n2. %s", lYes, lNo)
show_menu(g_voteCaller, 0x03, menuBody, 10, "The result: ")
set_task(10.0, "autoRefuse", AUTO_REFUSE_TASK)
}
else
set_task(2.0, "delayedExec", 0)
}
new lVotingSuccess[32]
for (i = 0; i < pnum; i++)
{
format(lVotingSuccess, 31, "%L", players, "VOTING_SUCCESS")
client_print(players, print_chat, "%L", players, "VOTING_RES_3", lVotingSuccess, iResult, iRatio, g_Answer)
}
format(lVotingSuccess, 31, "%L", "en", "VOTING_SUCCESS")
log_amx("Vote: %s (got ^"%d^") (needed ^"%d^") (result ^"%s^")", lVotingSuccess, iResult, iRatio, g_Answer)
return PLUGIN_CONTINUE
} 里,可无法得到投票人所以放弃了。 |
|