搜索
查看: 4691|回复: 20

高手看看源码,第1局刀战插件可以在AMX1.71上使用了吗?

[复制链接]
发表于 2006-5-19 10:21:23 | 显示全部楼层 |阅读模式 来自 中国–广东–深圳–南山区
听说AMXX1.71不怎么占用CPU,谁来看看小刀插件怎么改才可以在1.71上用呢?我想升1.71试试。:dribble:
/* AMX Mod script.
*
* Knife Arena
*
* amx_knives 1 - restricts weapons to knives
* 0 - enables all weapons
*
* NOTE: Plugin adminvote from AMX 0.9.x required!!!
*/

#include <amxmod>
#include <amxmisc>

new bool:KnifeEnabled
new option[2]
new round

public amx_enableknife(id,level,cid) {
if (!cmd_access(id,level,cid,1))
return PLUGIN_HANDLED

new arg1[4]
read_argv(1,arg1,3)

if (equal(arg1,"1")||equali(arg1,"on")){
KnifeEnabled = true
unpause("b","switchweapon")
}
else if (equal(arg1,"0")||equali(arg1,"off")){
KnifeEnabled = false
pause("b","switchweapon")
}
else {
console_print(id,"Knives Only Mode is %s",KnifeEnabled ? "enabled" : "disabled")
return PLUGIN_HANDLED
}

console_print(id,"Knives Only Mode %s",KnifeEnabled ? "enabled" : "disabled")
client_print(0,print_center,"Knives Only Mode Has Been %s!",KnifeEnabled ? "Enabled" : "Disabled")

engclient_cmd(0,"weapon_knife")

set_hudmessage(0, 100, 0, 0.05, 0.65, 2, 0.02, 10.0, 0.01, 0.1, 2)
show_hudmessage(0,KnifeEnabled ? "Knives Only Allowed" : "All Guns Allowed" )
return PLUGIN_HANDLED
}

public switchweapon(id){
new wpn = read_data(2)
if (wpn == CSW_C4) return PLUGIN_CONTINUE
if (round < get_cvar_num("amx_kniferound") && (wpn == CSW_HEGRENADE || wpn == CSW_SMOKEGRENADE || wpn == CSW_FLASHBANG)) return PLUGIN_CONTINUE
engclient_cmd(id,"weapon_knife")
return PLUGIN_CONTINUE
}

new votepistols[] = "\yAMX %s Knives Only Mode?\w^n^n1. Yes^n2. No"

public vote_knives(id){
new Float:voting = get_cvar_float("amx_last_voting")
if (voting > get_gametime()){
client_print(id,print_chat,"* There is already one voting...")
return PLUGIN_HANDLED
}
if (voting && voting + get_cvar_float("amx_vote_delay") > get_gametime()) {
client_print(id,print_chat,"* Voting not allowed at this time...")
return PLUGIN_HANDLED
}
new menu_msg[256]
format(menu_msg,255,votepistols,KnifeEnabled ? "Disable" : "Enable")
new Float:vote_time = get_cvar_float("amx_vote_time") + 2.0
set_cvar_float("amx_last_voting", get_gametime() + vote_time )
show_menu(0,(1<<0)|(1<<1),menu_msg,floatround(vote_time))
set_task(vote_time,"check_votes")
client_print(0,print_chat,"* Voting has started...")
option[0]=option[1]=0
return PLUGIN_HANDLED
}

public vote_count(id,key){
if ( get_cvar_float("amx_vote_answers") ) {
new name[32]
get_user_name(id,name,31)
client_print(0,print_chat,"* %s voted %s", name, key ? "against" : "for" )
}
++option[key]
return PLUGIN_HANDLED
}

public check_votes(id){
if (option[0] > option[1]){
server_cmd( "amx_knives %s", KnifeEnabled ? "off" : "on" )
client_print(0,print_chat,"* Voting successful (yes ^"%d^") (no ^"%d^").",option[0],option[1])
}
else{
client_print(0,print_chat,"* Voting failed (yes ^"%d^") (no ^"%d^").",option[0],option[1])
}
return PLUGIN_CONTINUE
}

public end_round(){
if (round >0)
round --
else
round = 0
if (!round)
pause("b","switchweapon")
else
unpause("b","switchweapon")
return PLUGIN_CONTINUE
}

public reset_round(){
round = get_cvar_num("amx_kniferound")
if (round >0) unpause("b","switchweapon")
return PLUGIN_CONTINUE
}

public reset_player(id){
if (round>0){
new sz[90]
new len = format(sz,89," 还有%i局为刀战模式。",round)
if (round < get_cvar_num("amx_kniferound")) format(sz[len],89-len,"^n 但是本局您可以使用手雷.")
set_hudmessage(200,0,0,-1.0,0.35,1,6.0,12.0,0.3,0.3,5)
show_hudmessage(id,sz)
}
}

public plugin_init() {
register_plugin("Knife Arena","0.9","tcquest78")
register_cvar("amx_kniferound","2")
register_event("CurWeapon","switchweapon","be","1=1","2!29")
register_concmd("amx_knives","amx_enableknife",ADMIN_LEVEL_B,"<1|0> - knives only mode")
register_clcmd("say /voteknives","vote_knives",0,"- start voting session for knives only mode")
register_menucmd(register_menuid("Knives Only Mode?"),(1<<0)|(1<<1),"vote_count")
register_event("SendAudio", "end_round", "a", "2=%!MRAD_terwin", "2=%!MRAD_ctwin", "2=%!MRAD_rounddraw")
register_event("TextMsg", "reset_round", "a", "2&#Game_C", "2&#Game_w")
register_event("ResetHUD","reset_player","b")
round = get_cvar_num("amx_kniferound")
if (!round) pause("b","switchweapon")
return PLUGIN_CONTINUE
}
发表于 2006-5-19 18:01:34 | 显示全部楼层 来自 中国–重庆–重庆

回复: 高手看看源码,第1局刀战插件可以在AMX1.71上使用了吗?

我也很需要这个查件在1.7运行
那位高手看看
回复

使用道具 举报

发表于 2006-5-19 21:20:19 | 显示全部楼层 来自 中国–福建–龙岩–漳平市

回复: 高手看看源码,第1局刀战插件可以在AMX1.71上使用了吗?

我的服务器有用过1.71版本,小刀局各种限制局都可以。

惟独一个反作弊。008发表的不能在1.71上使用。。

不过1.71的版本还是不稳定,一样会把玩家全部踢出!
回复

使用道具 举报

发表于 2006-5-19 21:51:41 | 显示全部楼层 来自 中国–湖北–武汉

回复: 高手看看源码,第1局刀战插件可以在AMX1.71上使用了吗?

Post by 老江湖
我的服务器有用过1.71版本,小刀局各种限制局都可以。

惟独一个反作弊。008发表的不能在1.71上使用。。

不过1.71的版本还是不稳定,一样会把玩家全部踢出!


[color="Blue"]据说,这是CS内部引擎的问题;同时,新的CS新的版本好像部分解决这个问题了。


[color="Red"]已经修改过的 Knife Arena 在附件里面。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
回复

使用道具 举报

 楼主| 发表于 2006-5-20 07:24:36 | 显示全部楼层 来自 中国–广东–深圳–南山区

回复: 高手看看源码,第1局刀战插件可以在AMX1.71上使用了吗?

Post by kinsprite
[color="Blue"]据说,这是CS内部引擎的问题;同时,新的CS新的版本好像部分解决这个问题了。


[color="Red"]已经修改过的 Knife Arena 在附件里面。

哈哈,3Q。。。我刚才试了下真好用,此插件终于可以在高版本上用了。kinsprite你行,有你的!:eek: :dribble:
不麻烦的话还是需要把那些全汉化为中文。呵呵,麻烦就不用了。
回复

使用道具 举报

发表于 2006-5-20 10:19:47 | 显示全部楼层 来自 中国–重庆–重庆

回复: 高手看看源码,第1局刀战插件可以在AMX1.71上使用了吗?

终于搞到了.......谢谢
正需要这个
回复

使用道具 举报

 楼主| 发表于 2006-5-20 10:52:49 | 显示全部楼层 来自 中国–广东–深圳

回复: 高手看看源码,第1局刀战插件可以在AMX1.71上使用了吗?

Post by CS菜鸟鸟
终于搞到了.......谢谢
正需要这个

呵呵,只要第1局刀战的朋友可以在amx.cfg里添加一行 amx_kniferound 1
回复

使用道具 举报

发表于 2006-5-22 15:44:17 | 显示全部楼层 来自 中国–云南–曲靖

回复: 高手看看源码,第1局刀战插件可以在AMX1.71上使用了吗?

Post by AE86
呵呵,只要第1局刀战的朋友可以在amx.cfg里添加一行 amx_kniferound 1


我要三局,是不是可以这样写:

amx_kniferound 3
回复

使用道具 举报

 楼主| 发表于 2006-5-22 16:14:54 | 显示全部楼层 来自 中国–广东–深圳–南山区

回复: 高手看看源码,第1局刀战插件可以在AMX1.71上使用了吗?

Post by xiaolysh
我要三局,是不是可以这样写:

amx_kniferound 3

呵呵,我想应该是可以的,
回复

使用道具 举报

 楼主| 发表于 2006-5-24 23:25:00 | 显示全部楼层 来自 中国–广东–深圳–南山区

回复: 高手看看源码,第1局刀战插件可以在AMX1.71上使用了吗?

对啦,不让第一局安C4该任何改了呢?
第1局埋包了整个刀局都失去意义了。
回复

使用道具 举报

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

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