搜索
查看: 2497|回复: 7

恳求帮把"杀N人"改成"暴N头"就投票.....附上

[复制链接]
发表于 2007-11-8 10:00:21 | 显示全部楼层 |阅读模式 来自 中国–广西–百色–右江区
里面的源码是杀了N人不死就投票说是否作弊,感觉不够理想,因为开作弊器一般都是暴头..所以想改成暴头达N人不死就举行一次投票,可以帮这忙吗?版主...
*********************************************************/
#include <amxmodx>
#include <amxmisc>

#define KEY8 (1<<7)
#define KEY9 (1<<8)

new kill[33] // 接连杀数目记数
new votekill[33] // 投票连杀数目
new bool:g_voting // 一个正在进行的投票
new bool:isVoted[33] // 正在被投票
new g_voteCount[2]

new g_voteResStr[2][12] = {"是","不是"}
public plugin_init(){
register_plugin("conkill","1.0", "Oh ye~")
register_event("DeathMsg", "death", "a")
register_logevent("newRound", 2, "0=World triggered", "1=Round_Start") // 回合
register_menucmd(register_menuid("VoteMenu"), KEY8|KEY9, "actionMenu")

register_cvar("amx_conkill_vote","5") // 投票连杀数目(默认:5)
register_cvar("amx_conkill_voterate","0.5") // 投票成功比例(默认:0.5)

register_cvar("amx_conkill_kick","1") // 接连杀踢或封禁(默认:1踢)
register_cvar("amx_conkill_bantime","11.0") // 封禁时间(默认:11.0)
register_cvar("amx_conkill_show","1") // 显示踢、封信息(默认:1是)
}

public client_color( playerid, colorid, msg[]){
message_begin( playerid?MSG_ONE:MSG_ALL, get_user_msgid("SayText"), {0,0,0}, playerid)
write_byte(colorid)
write_string(msg)
message_end()
}
//数据初始化
public client_connect(id){
kill[id] = 0
votekill[id] = 0
return PLUGIN_CONTINUE
}

public client_disconnect(id){
if( isVoted[id] ){
new ipStr[16],pname[32]
get_user_ip( id, ipStr, 15, 1 )
get_user_name( id, pname, 31)

new Msg[128]
format( Msg, 127, "^x01* 注意:^x03%s^x01中途离开,将被封禁", pname)
client_color(0, id, Msg)

new Float:bantime = get_cvar_float("amx_conkill_bantime")
server_cmd("addip %.2f %s;wait;writeip", bantime, ipStr) // 封IP

if( isVoted[id])
isVoted[id] = false
}
return PLUGIN_CONTINUE
}

public newRound(){
new players[32],num
get_players( players, num)
for( new i = 0; i < num; i++ )
kill[players] = 0
}

public death(){
new killer = read_data(1)
new victim = read_data(2)

if( killer != victim ){
new players[32],num
get_players( players, num)
for( new i = 0; i < num; i++ ){

if(victim == players){
votekill[players] = 0
}

}
return PLUGIN_CONTINUE
}

public InitVote(target){
if( !is_user_connected(target) || access( target, ADMIN_IMMUNITY) || g_voting )
return PLUGIN_HANDLED
g_voteCount[0]=0
g_voteCount[1]=0
isVoted[target] = true // 正在被投票
g_voting = true // 一个正在进行的投票

new menuBody[512],pname[32]
get_user_name(target,pname,31)

new len=format(menuBody,511,"\y注意: %s连续暴头%d个,他是在作弊吗?^n", pname, get_cvar_num("amx_conkill_vote") )
len+=format(menuBody[len],511-len,"\w8.是^n")
len+=format(menuBody[len],511-len,"\w9.不是^n")
show_menu( 0, KEY8|KEY9, menuBody, 11,"anyVoteMenu")

set_task( 11.0 + 1.0,"showResult",target)
return PLUGIN_HANDLED
}


public actionMenu(id,key){
g_voteCount[key-7]++
new pname[32],msg[128]
get_user_name(id,pname,31)
format(msg,127,"^x01* ^x03%s^x01选^x04%s",pname,g_voteResStr[key-7])
client_color( 0, id, msg)
return PLUGIN_HANDLED
}
public showResult(target){
isVoted[target] = false
g_voting = false
new Float:result = 0.0
new msg[128]
result = ( g_voteCount[0]+g_voteCount[1] ) ? (float(g_voteCount[0]) / float( g_voteCount[0]+g_voteCount[1] ) ) : 0.0
if( result >= get_cvar_float("amx_conkill_voterate") ){
format(msg,127,"^x01* 投票结果:^x03%0.1f^x01.同意^x04是^x03%d^x01,同意^x04不是^x03%d^x01,作弊者将立刻被封禁...",result,g_voteCount[0],g_voteCount[1])
new ipStr[16]
get_user_ip( target, ipStr, 15, 1 )
if( get_cvar_num("amx_conkill_kick") ){
server_cmd( "kick #%d ^"你连续杀了%d个而没有阵亡,太牛了^"", target, votekill[target])
}
else{
new Float:bantime = get_cvar_float("amx_conkill_bantime")
server_cmd("addip %.2f %s;wait;writeip", bantime, ipStr) // 封IP
}
}
else
format(msg,127,"^x01* 投票结果:^x03%0.1f^x04是^x03%d^x04,不是^x03%d",result,g_voteCount[0],g_voteCount[1])
client_color( 0, target, msg)
return PLUGIN_HANDLED
}
发表于 2007-11-8 11:02:06 | 显示全部楼层 来自 中国–河南–郑州

回复: 恳求帮把&quot;杀N人&quot;改成&quot;暴N头&quot;就投票....

晕!自己改个字都不会啊!
回复

使用道具 举报

 楼主| 发表于 2007-11-8 13:05:40 | 显示全部楼层 来自 中国–广西–百色–右江区

回复: 恳求帮把&quot;杀N人&quot;改成&quot;暴N头&quot;就投票....

是不是把里面的kill和votekill全部改成什么的....可是我不懂"暴头"的英文词....
回复

使用道具 举报

 楼主| 发表于 2007-11-8 15:30:05 | 显示全部楼层 来自 中国–广西–百色–那坡县

回复: 恳求帮把&quot;杀N人&quot;改成&quot;暴N头&quot;就投票....

Post by all85100
晕!自己改个字都不会啊!
这位大哥..帮帮小妹我一下啊...俺不会改.....
回复

使用道具 举报

 楼主| 发表于 2007-11-8 19:12:31 | 显示全部楼层 来自 中国–广西–百色

回复: 恳求帮把&quot;杀N人&quot;改成&quot;暴N头&quot;就投票....

这位版主回答好象不大妥吧...说这句话使人感觉就象:一个人不舒服了来到点通这个医院求医,而你只说了"不舒服难道不会吃药吗?"而已......并没有指出痛在哪里.........这如何能解决问题啊?...."授人以鱼,亦授人以渔"名言啊.......
难道点通不再是医生而变成药店了?对会员好象已经不再那么关心了?.......
回复

使用道具 举报

 楼主| 发表于 2007-11-8 19:16:35 | 显示全部楼层 来自 中国–广西–百色

回复: 恳求帮把&quot;杀N人&quot;改成&quot;暴N头&quot;就投票....

Post by all85100
晕!自己改个字都不会啊!
这位版主回答好象不大妥吧...说这句话使人感觉就象:一个人不舒服了来到点通这个医院求医,而你只说了"不舒服难道不会吃药吗?"而已......并没有指出痛在哪里.........这如何能解决问题啊?...."授人以鱼,亦授人以渔"名言啊.......
难道点通不再是医生而变成药店了?对会员好象已经不再那么关心了?.......
回复

使用道具 举报

发表于 2007-11-9 01:14:33 | 显示全部楼层 来自 中国–广东–深圳

回复: 恳求帮把&quot;杀N人&quot;改成&quot;暴N头&quot;就投票....

把这行[php]if( killer != victim )[/php]
加多几个字就可以了[php]if( killer != victim ) && read_data(3)==1)[/php]
回复

使用道具 举报

 楼主| 发表于 2007-11-9 15:58:39 | 显示全部楼层 来自 中国–广西–百色

回复: 恳求帮把&quot;杀N人&quot;改成&quot;暴N头&quot;就投票....

测试很好........衷心感谢您.......我爱你....
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表