投票踢人修改版(投票必须2888元)[附源码]
还是比较菜,现的设置是投票成功与不成功都扣除2888元(扣除多少可以源码里修改),本来意愿是设置成投票成功不扣钱,不成功扣钱,可在获取投票人里卡住了,如有高手请帮忙修正一下更好,谢谢。希望下载的支持顶一下,必竟测试花了我一个小时时间去了。又来鄙视一下投票踢人扣钱不发源码的。回复: 投票踢人修改版(投票必须2888元)[附源码]
cs_set_user_money(data, cs_get_user_money(data)-2888)这条语句放到client_print(0, print_chat, "* [%s]成功投票踢人!", name)
下呢。我思路是得到成功的信息后再去扣钱,代码我也没仔细看太迟了困的厉害。
回复: 投票踢人修改版(投票必须2888元)[附源码]
没附件···怎么下载
楼主看看
回复: 投票踢人修改版(投票必须2888元)[附源码]
鄙视一下下了就走人的,不想隐藏,自愿回复就回复吧。回冰河老兄,代码本来是想放在public checkVotes() {new votesNum = g_voteCount + g_voteCount
new iRatio = votesNum ? floatround(g_voteRatio * float(votesNum), floatround_ceil) : 1
new iResult = g_voteCount
new players, pnum, i
get_players(players, pnum, "c")
if (iResult < iRatio)
{
new lVotingFailed
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, g_voteCount, iRatio)
cs_set_user_money(data, cs_get_user_money(data)-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, lTheResult, lYes, lNo
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, 511 - len, g_coloredMenus ? "\y%L^n\w" : "%L^n", g_voteCaller, "WANT_CONTINUE")
format(menuBody, 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
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
}
里,可无法得到投票人所以放弃了。
回复: 投票踢人修改版(投票必须2888元)[附源码]
我改了下可以了,在是否继续菜单出现后进行扣钱,这样就不会出现投票不通过也扣钱了,通过了就扣钱执行不执行都扣钱,使用了R斑主的金钱插件,这个对钱的正确判断好。len += format(menuBody, 511 - len, g_coloredMenus ? "\y%L^n\w" : "%L^n", g_voteCaller, "WANT_CONTINUE")
format(menuBody, 511 - len, "^n1. %s^n2. %s", lYes, lNo)
cs_set_user_money2(g_voteCaller, cs_get_user_money2(g_voteCaller)-2888)
你原来说无法得到投票人,其实可以通过g_voteCaller这个来获取。