nwb13和各位高手进关于抢夺旗子模式问题
关于抢夺旗子模式虽然是不错。但是发现了一些问题最主要问题是。重生时间设置?太快了。如果一死了马上重生是更本不可能冲进地方基地的。所以希望高手和nwb13把抢夺旗子模式的重生时间改改
我看了下源玛,小弟太菜实在找不到那里设置应该不是这里吧
set_cvar_num("sv_restartround", 3)
set_cvar_num("mp_buytime", 7)
set_cvar_num("mp_roundtime", 7)
set_cvar_num("mp_startmoney", 1800)
set_cvar_num("amx_spawn_protect", 0)
但是这里我发现可能是。但是不知道怎么改?message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte( TE_BEAMPOINTS )
write_coord(s_origin)
write_coord(s_origin)
write_coord(s_origin)
write_coord(f_origin)
write_coord(f_origin)
write_coord(f_origin)
write_short( beam )
write_byte( 1 ) // framestart
write_byte( 1 ) // framerate
write_byte( blife )// life in 0.1's 《==========可能是这里但是不知道怎么改成20秒后重生
write_byte( bwidth ) // width
write_byte( 0 ) // noise
write_byte( bred ) // red
write_byte( bgreen ) // green
write_byte( bblue )// blue
write_byte( 200 ) // brightness
write_byte( 0 ) // speed
message_end()
}
回复: nwb13和各位高手进关于抢夺旗子模式问题
这个模式虽然有种种问题,但是很多玩家挺爱玩的。非常明显感觉到这个模式非常占用资源,即使服务器能够承受但是有很多客户端无法承受,FPS骤降到10都有可能 :sweat: 。建议设置在22人以下。
通过实际试完,与其说是夺旗模式还不如说是夺枪模式。熟悉此模式的玩家多少意识到胜利的关键其实在于夺枪。你说根本无法夺到旗,是因为玩家还不熟悉此模式的原因,慢慢来吧!如果你想让一方更加容易的夺到旗可以设置
amx_ctf_guard 8 // 默认:8//重生之后可使用武器的延迟时间。
设置的比8高一些。不过会发生一方被狂虐的情况 。:)
建议设置可以购买武器的时间为30以内,一旦武器过多将导致服务器出错被强迫关闭的情况。每局的时间设置为5以内,建议3分。
回复: nwb13和各位高手进关于抢夺旗子模式问题
谢谢你我正在绝望呢。以为DT没人帮助了
我以前发的帖子没人帮助过。我都绝望了还以为DT没人了
回复: nwb13和各位高手进关于抢夺旗子模式问题
好象设置成保护时间20秒不行~是不是过高了不然真的不好冲出去
那位高手给小弟指出啊/* AMXMODX script.
*
* (c) Copyright 2004, Made by GHW_Chronic - This file is provided as is (no warranties).
*
*
* CAPTURE THE FLAG VERSION 1.0 - Tested to work on CS
*
* v1.7 changed to be compatable with all AMXX versions
*
* V1.6 With AMXX - Changed messages to help avoid confusion
*
* v1.0 - Added CTF guard feature
* - Improved scoreboard tracking
* - Fixed some run time errors
* - Various bug fixes
*
* v0.9 - Public release
*
*/
#include <amxmodx>
#include <amxmod>
#define TE_BEAMPOINTS 0
new ctfrunning, beam, gmsgTeamScore
new fr_stand, fr_origin, fr_holder, fr_return, fr_score, fr_status = "基地"
new fb_stand, fb_origin, fb_holder, fb_return, fb_score, fb_status = "基地"
new protected, guard_time
new fr_team = "TERRORIST"
new fb_team = "CT"
new fr_team_cn = "恐怖份子"
new fb_team_cn = "反恐精英"
public plugin_init()
{
register_plugin("Capture The Flag", "1.0", "GHW_Chronic|nwb13")
set_task(0.1,"drawflag",0,"",0,"b")
set_task(0.5,"checkflag",0,"",0,"b")
set_task(1.0,"drawflagstand",0,"",0,"b")
set_task(5.0,"check_cvar",0,"",0,"b")
register_event("DeathMsg","checkdeath","a")
register_event("Damage", "checkdamage", "b", "2!0")
register_event("ResetHUD", "startofround", "bce")
register_event("CurWeapon","switchweapon","be","1=1","2!29")
register_cvar("amx_ctf","1")
register_cvar("amx_ctf_guard", "8")
register_cvar("amx_ctf_version", "1.1",FCVAR_SERVER)
gmsgTeamScore = get_user_msgid("TeamScore")
}
public plugin_precache()
{
beam = precache_model("sprites/dot.spr")
}
public check_cvar()
{
if (get_cvar_num("amx_ctf"))
{
message_begin(MSG_ALL, gmsgTeamScore)
write_string(fr_team)
write_short(fr_score)
message_end()
message_begin(MSG_ALL, gmsgTeamScore)
write_string(fb_team)
write_short(fb_score)
message_end()
new team1, team2
for(new a = 1; a <= get_maxplayers(); ++a)
{
if (get_user_team(a) == 1)
{
team1 += 1
if (!(is_user_alive(a)) && ctfrunning == 1 )
{
new ids
ids = a
spawnplayer(ids)
}
}
else if (get_user_team(a) == 2)
{
team2 += 1
if (!(is_user_alive(a)) && ctfrunning == 1 )
{
new ids
ids = a
spawnplayer(ids)
}
}
}
guard_time = get_cvar_num("amx_ctf_guard")
if (guard_time < 4)
{
guard_time = 4
set_cvar_num("amx_ctf_guard", 4)
}
if (ctfrunning == 1)
{
return PLUGIN_CONTINUE
}
if (team1 > 1 && team2 > 1)
{
ctfrunning = 1
set_cvar_num("sv_restartround", 3)
set_cvar_num("mp_buytime", 7)
set_cvar_num("mp_roundtime", 7)
set_cvar_num("mp_startmoney", 1800)
set_cvar_num("amx_spawn_protect", 0)
}
else
{
set_hudmessage(0, 100, 0, -1.0, 0.85, 0, 4.0, 4.0, 1.0, 1.0, 20)
show_hudmessage(0,"夺旗模式 V1.1^n等待双方队伍中各有2名玩家")
}
}
else if (!(get_cvar_num("amx_ctf")))
{
ctfrunning = 0
}
return PLUGIN_CONTINUE
}
public switchweapon(id)
{
if (!(ctfrunning))
{
return PLUGIN_CONTINUE
}
new weapon=read_data(2)
if (protected > 0)
{
client_print(id,print_chat,"夺旗模式保护提示: 你将在 %i 秒后可以使用武器.",protected)
engclient_cmd(id,"weapon_knife")
}
if (weapon == 6)
{
client_print(id,print_chat,"夺旗模式提示: 在夺旗模式里不允许放置炸弹.")
engclient_cmd(id,"weapon_knife")
}
return PLUGIN_CONTINUE
}
public drawflag()
{
if (!(ctfrunning))
{
return PLUGIN_CONTINUE
}
new s_origin, f_origin
if (is_user_alive(fr_holder))
{
get_user_origin(fr_holder,fr_origin)
fr_origin += 15
}
if (is_user_alive(fb_holder))
{
get_user_origin(fb_holder,fb_origin)
fb_origin += 15
}
s_origin = fr_origin
f_origin = fr_origin
f_origin += 20
drawbeam(s_origin,f_origin,1,3,200,200,200)
s_origin = f_origin
f_origin += 20
drawbeam(s_origin,f_origin,1,80,200,0,0)
s_origin = fb_origin
f_origin = fb_origin
f_origin += 20
drawbeam(s_origin,f_origin,1,3,200,200,200)
s_origin = f_origin
f_origin += 20
drawbeam(s_origin,f_origin,1,80,0,0,200)
return PLUGIN_CONTINUE
}
public client_disconnect(id)
{
if (!(ctfrunning))
{
return PLUGIN_CONTINUE
}
protected = 0
if (id == fr_holder)
{
set_hudmessage(0, 200, 0, -1.0, 0.4, 0, 3.0, 6.0, 0.1, 0.0, 9)
show_hudmessage(0,"%s 离开了游戏, 丢掉了 %s 的旗帜 !!!",fr_status,fr_team_cn)
fr_return = 30
fr_holder = -1
fr_origin -= 10
}
if (id == fb_holder)
{
set_hudmessage(0, 200, 0, -1.0, 0.6, 0, 3.0, 6.0, 0.1, 0.0, 10)
show_hudmessage(0,"%s 离开了游戏, 丢掉了 %s 的旗帜 !!!",fb_status,fb_team_cn)
fb_return = 30
fb_holder = -1
fb_origin -= 10
}
return PLUGIN_CONTINUE
}
public checkdeath()
{
if (!(ctfrunning))
{
return PLUGIN_CONTINUE
}
new killer = read_data(1)
new victim = read_data(2)
if (victim == fr_holder)
{
set_hudmessage(0, 200, 0, -1.0, 0.4, 0, 3.0, 6.0, 0.1, 0.0, 9)
show_hudmessage(0,"%s 丢掉了 %s 的旗帜 !!!",fr_status,fr_team_cn)
fr_return = 30
fr_holder = -1
fr_origin -= 25
new money = get_user_money(killer)
set_user_money(killer,money+1000,1)
}
if (victim == fb_holder)
{
set_hudmessage(0, 200, 0, -1.0, 0.6, 0, 3.0, 6.0, 0.1, 0.0, 10)
show_hudmessage(0,"%s 丢掉了 %s 的旗帜 !!!",fb_status,fb_team_cn)
fb_return = 30
fb_holder = -1
fb_origin -= 25
new money = get_user_money(killer)
set_user_money(killer,money+1000,1)
}
new ids
ids = victim
set_task(0.8,"spawnplayer",0,ids,1)
return PLUGIN_CONTINUE
}
public checkdamage(id)
{
if (!(ctfrunning))
{
return PLUGIN_CONTINUE
}
if (protected > 0)
{
set_user_health(id,250)
//client_print(id,print_chat,"CTF GUARD IS PROTECTING YOU")
}
return PLUGIN_CONTINUE
}
public spawnplayer(ids[])
{
new victim = ids
protected = guard_time
user_spawn(victim)
set_user_health(victim,250)
new money = get_user_money(victim)
if (money < 1800)
{
money = 1800
}
set_user_money(victim,money,0)
new pl_origin
get_user_origin(victim,pl_origin)
pl_origin -= 2000
set_user_origin(victim,pl_origin)
new iweapons, wpname, inum
get_user_weapons(victim,iweapons,inum)
for(new a=0;a<inum;++a)
{
get_weaponname(iweapons,wpname,31)
engclient_cmd(victim,"drop",wpname)
}
pl_origin += 2005
give_item(victim,"weapon_knife")
set_user_origin(victim,pl_origin)
set_user_rendering(victim,kRenderFxGlowShell,200,200,100,kRenderNormal)
return PLUGIN_CONTINUE
}
public checkflag()
{
if (!(ctfrunning))
{
return PLUGIN_CONTINUE
}
for(new a = 1; a <= get_maxplayers(); ++a)
{
if (is_user_alive(a))
{
new pl_origin
get_user_origin(a,pl_origin)
if (pl_origin > (fb_origin - 40) && pl_origin < (fb_origin + 40))
{
if (pl_origin > (fb_origin - 40) && pl_origin < (fb_origin + 40))
{
if (pl_origin > (fb_origin - 60) && pl_origin < (fb_origin + 80))
{
if (get_user_team(a) == 1 && fb_holder < 1)
{
if (protected > 0)
{
client_print(a,print_chat,"夺旗模式: 在保护结束之前你不能取得对方的旗帜, 请稍候.")
}
else
{
fb_holder = a
get_user_name(a,fb_status,32)
set_user_rendering(a,kRenderFxGlowShell,200,0,0,kRenderNormal)
new money = get_user_money(a)
set_user_money(a,money + 1000,1)
set_hudmessage(0, 200, 0, -1.0, 0.4, 0, 3.0, 6.0, 0.1, 0.0, 9)
show_hudmessage(0,"%s 拿到了 %s 的旗帜 !!!",fb_status,fb_team_cn)
}
}
else if (get_user_team(a) == 2 && fb_holder == -1)
{
if (protected > 0)
{
client_print(a,print_chat,"夺旗模式: 在保护结束之前你不能取得对方的旗帜, 请稍候.")
}
else
{
fb_return = 1
}
}
}
}
}
if (pl_origin > (fr_origin - 40) && pl_origin < (fr_origin + 40))
{
if (pl_origin > (fr_origin - 40) && pl_origin < (fr_origin + 40))
{
if (pl_origin > (fr_origin - 60) && pl_origin < (fr_origin + 80))
{
if (get_user_team(a) == 2 && fr_holder < 1)
{
if (protected > 0)
{
client_print(a,print_chat,"夺旗模式: 在保护结束之前你不能取得对方的旗帜, 请稍候.")
}
else
{
fr_holder = a
get_user_name(a,fr_status,32)
set_user_rendering(a,kRenderFxGlowShell,0,0,200,kRenderNormal)
new money = get_user_money(a)
set_user_money(a,money + 1000,1)
set_hudmessage(0, 200, 0, -1.0, 0.6, 0, 3.0, 6.0, 0.1, 0.0, 10)
show_hudmessage(0,"%s 拿到了 %s 的旗帜 !!!",fr_status,fr_team_cn)
}
}
else if (get_user_team(a) == 1 && fr_holder == -1)
{
if (protected > 0)
{
client_print(a,print_chat,"夺旗模式: 在保护结束之前你不能运回己方的旗帜, 请稍候.")
}
else
{
fr_return = 1
}
}
}
}
}
}
}
if (fr_holder == 0 && fb_holder != 0)
{
if (is_user_alive(fb_holder))
{
new pl_origin
get_user_origin(fb_holder,pl_origin)
if (pl_origin > (fr_stand - 40) && pl_origin < (fr_stand + 40))
{
if (pl_origin > (fr_stand - 40) && pl_origin < (fr_stand + 40))
{
if (pl_origin > (fr_stand - 40) && pl_origin < (fr_stand + 40))
{
for(new a = 1; a <= get_maxplayers(); ++a)
{
if (get_user_team(a) == 1)
{
new money = get_user_money(a)
if (a == fb_holder)
{
money += 6000
}
else
{
money += 4000
}
set_user_money(a,money,1)
}
}
fr_score += 1
set_user_frags(fb_holder, get_user_frags(fb_holder) + 1)
set_hudmessage(0, 200, 0, -1.0, -1.0, 0, 3.0, 6.0, 0.1, 0.0, 10)
show_hudmessage(0,"%s 成功夺取了 %s 的旗帜 !!!^n%s: %i - %s: %i",fb_status,fb_team_cn,fr_team_cn,fr_score,fb_team_cn,fb_score)
set_user_rendering(fb_holder,kRenderFxNone,0,0,0,kRenderNormal)
fb_holder = 0
fb_origin = fb_stand
fb_status = "基地"
}
}
}
}
}
if (fb_holder == 0 && fr_holder != 0)
{
if (is_user_alive(fr_holder))
{
new pl_origin
get_user_origin(fr_holder,pl_origin)
if (pl_origin > (fb_stand - 40) && pl_origin < (fb_stand + 40))
{
if (pl_origin > (fb_stand - 40) && pl_origin < (fb_stand + 40))
{
if (pl_origin > (fb_stand - 40) && pl_origin < (fb_stand + 40))
{
for(new a = 1; a <= get_maxplayers(); ++a)
{
if (get_user_team(a) == 2)
{
new money = get_user_money(a)
if (a == fr_holder)
{
money += 6000
}
else
{
money += 4000
}
set_user_money(a,money,1)
}
}
fb_score += 1
set_user_frags(fr_holder, get_user_frags(fr_holder) + 1)
set_hudmessage(0, 200, 0, -1.0, -1.0, 0, 3.0, 6.0, 0.1, 0.0, 10)
show_hudmessage(0,"%s 成功夺取了 %s 的旗帜 !!!^n%s: %i - %s: %i",fr_status,fr_team_cn,fb_team_cn,fb_score,fr_team_cn,fr_score)
set_user_rendering(fr_holder,kRenderFxNone,0,0,0,kRenderNormal)
fr_holder = 0
fr_origin = fr_stand
fr_status = "基地"
}
}
}
}
}
return PLUGIN_CONTINUE
}
public startofround()
{
if (!(ctfrunning))
{
return PLUGIN_CONTINUE
}
for(new a = 1; a <= get_maxplayers(); ++a)
{
if (protected > 0)
{
protected = 2
}
}
if (fr_holder == 0 && fb_holder != 0)
{
set_user_rendering(fb_holder,kRenderFxNone,0,0,0,kRenderNormal)
fb_holder = 0
fb_origin = fb_stand
fb_status = "基地"
}
if (fb_holder == 0 && fr_holder != 0)
{
set_user_rendering(fr_holder,kRenderFxNone,0,0,0,kRenderNormal)
fr_holder = 0
fr_origin = fr_stand
fr_status = "基地"
}
if (fr_stand != fb_stand)
{
return PLUGIN_CONTINUE
}
set_task(3.0,"locateflagstand")
return PLUGIN_CONTINUE
}
public locateflagstand()
{
for(new a = 1; a <= get_maxplayers(); ++a)
{
if (get_user_team(a) == 1)
{
get_user_origin(a,fr_stand)
fr_origin = fr_stand
}
else if (get_user_team(a) == 2)
{
get_user_origin(a,fb_stand)
fb_origin = fb_stand
}
}
return PLUGIN_CONTINUE
}
public drawflagstand(id)
{
if (!(ctfrunning))
{
return PLUGIN_CONTINUE
}
if (fr_stand != 0 || fb_stand != 0)
{
new s_origin, f_origin
s_origin = fr_stand
f_origin = fr_stand
s_origin += 10
f_origin -= 35
f_origin -= 30
f_origin -= 30
drawbeam(s_origin,f_origin,10,10,0,200,0)
f_origin += 60
drawbeam(s_origin,f_origin,10,10,0,200,0)
f_origin += 60
drawbeam(s_origin,f_origin,10,10,0,200,0)
f_origin -= 60
drawbeam(s_origin,f_origin,10,10,0,200,0)
s_origin = fb_stand
f_origin = fb_stand
s_origin += 10
f_origin -= 35
f_origin -= 30
f_origin -= 30
drawbeam(s_origin,f_origin,10,10,0,200,0)
f_origin += 60
drawbeam(s_origin,f_origin,10,10,0,200,0)
f_origin += 60
drawbeam(s_origin,f_origin,10,10,0,200,0)
f_origin -= 60
drawbeam(s_origin,f_origin,10,10,0,200,0)
}
set_hudmessage(200, 0, 0, -1.0, 0.03, 0, 0.9, 1.0, 0.1, 0.0, 7)
show_hudmessage(0,"红队旗帜: %s",fr_status)
set_hudmessage(0, 0, 200, -1.0, 0.06, 0, 0.9, 1.0, 0.1, 0.0, 8)
show_hudmessage(0,"蓝队旗帜: %s",fb_status)
if (fr_holder == -1)
{
fr_return -= 1
numtostr(fr_return, fr_status, 3)
if (fr_return == 0)
{
set_hudmessage(0, 200, 0, -1.0, 0.6, 0, 3.0, 3.0, 0.1, 0.0, 9)
show_hudmessage(0,"%s 的旗帜被运回了基地",fr_team_cn)
fr_holder = 0
fr_origin = fr_stand
fr_status = "基地"
}
}
if (fb_holder == -1)
{
fb_return -= 1
numtostr(fb_return, fb_status, 3)
if (fb_return == 0)
{
set_hudmessage(0, 200, 0, -1.0, 0.4, 0, 3.0, 3.0, 0.1, 0.0, 10)
show_hudmessage(0,"%s 的旗帜被运回了基地",fb_team_cn)
fb_holder = 0
fb_origin = fb_stand
fb_status = "基地"
}
}
for(new a = 1; a <= get_maxplayers(); ++a)
{
if (protected == 1)
{
set_user_health(a,100)
set_user_rendering(a,kRenderFxNone,0,0,0,kRenderNormal)
}
if (protected == (guard_time - 1))
{
set_user_rendering(a,kRenderFxGlowShell,200,200,100,kRenderNormal)
client_print(a,print_chat,"夺旗模式保护提示: 你在 %i 秒内不会被杀死.",protected)
}
if (protected > 0)
{
protected -= 1
set_hudmessage(200, 200, 200, 0.03, 0.89, 0, 0.9, 1.0, 0.1, 0.0, 13)
show_hudmessage(a,"夺旗模式保护时间: %i",protected)
}
}
return PLUGIN_CONTINUE
}
public drawbeam(s_origin,f_origin,blife,bwidth,bred,bgreen,bblue)
{
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte( TE_BEAMPOINTS )
write_coord(s_origin)
write_coord(s_origin)
write_coord(s_origin)
write_coord(f_origin)
write_coord(f_origin)
write_coord(f_origin)
write_short( beam )
write_byte( 1 ) // framestart
write_byte( 1 ) // framerate
write_byte( blife )// life in 0.1's
write_byte( bwidth ) // width
write_byte( 0 ) // noise
write_byte( bred ) // red
write_byte( bgreen ) // green
write_byte( bblue )// blue
write_byte( 200 ) // brightness
write_byte( 0 ) // speed
message_end()
}
回复: nwb13和各位高手进关于抢夺旗子模式问题
建议你爬爬文,会有收获的!回复: nwb13和各位高手进关于抢夺旗子模式问题
大哥不是问个插件也这样说吧
就这么简单的帮助也没人
怪说别人说DT现在不热心了
回复: nwb13和各位高手进关于抢夺旗子模式问题
2楼帖子里给你回复的已经够详细了。你还想知道什么?你4楼贴发的什么?还让人看贴不?就冲着4楼贴,很多人都不会给你回帖。
你不会用附件形式发上来吗?
坛子里有相关的贴子,让爬爬文有什么问题吗?
自己懒惰,不要埋怨别人或论坛!XX一个 ! :sweat:
回复: nwb13和各位高手进关于抢夺旗子模式问题
大哥我4楼发的帖子是说出我感谢的话还有就是说的事实
确实现在DT帮助人的很少。发个帮助帖子基本上没人回复。你说叫人看了心痛不
还有就是你回复的哪个答案更本不行。不然我怎么在发帖子嘛
我设置的是amx_ctf_guard 20
是添加在AMX。CFG里面的
页:
[1]