有时不会处死是因为AMXX函数的一个BUG,下面是修正后的代码,不会出现出现这种情况,死法只保留了一种,被雷打死。/* AMX MOD X script.
* This file is provided as is with no warranty.
*
* Effect: Losing the objective results in a random orgy of GFX destruction
* for the losing team (everyone on the losing team DIES).
* CVAR: Set mp_slaylosers to 0 if you want to turn it off.
*/
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
new lightning
new g_sModelIndexSmoke
public plugin_init()
{
register_plugin("AMX Slay Losers","1.1","d3n14@yahoo.com")
register_event("SendAudio","end_round","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw")
register_cvar("mp_slaylosers","1",FCVAR_SERVER)
return PLUGIN_CONTINUE
}
public end_round()
{
// Only active if CVAR is not equal to 0
if( get_cvar_num("mp_slaylosers") )
{
new parm
new len = read_data(2,parm,31)
set_task(0.3,"slay_those_losers",0,parm, len + 1)
}
return PLUGIN_CONTINUE
}
// Slays each player who failed to stop the other team from completing the objective.
public slay_those_losers(parm[])
{
new origin, srco
new player, playersnum
new id
new CsTeams:team = (parm == 't') ? CS_TEAM_CT : CS_TEAM_T
get_players(player,playersnum,"a")
for(new i = 0; i < playersnum; ++i)
{
id = player
// 不是失败方队员直接跳过
if(team != cs_get_user_team(id))
continue;
get_user_origin(id,origin)
origin -= 26
srco=origin+150
srco=origin+150
srco=origin+800
slay_lightning(srco,origin)
emit_sound(id,CHAN_ITEM, "ambience/thunder_clap.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
set_hudmessage(178, 14, 41, -1.0, -0.4, 1, 0.5, 1.7, 0.2, 0.2,3);
show_hudmessage(id, "任务失败^n所有失败方幸存队员将被处死!" );
user_kill(id,1)
//set_user_frags(id, get_user_frags(id)+0)
}
}
slay_lightning(vec1,vec2)
{
//Lightning
message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
write_byte( 0 )
write_coord(vec1)
write_coord(vec1)
write_coord(vec1)
write_coord(vec2)
write_coord(vec2)
write_coord(vec2)
write_short( lightning )
write_byte( 1 ) // framestart
write_byte( 5 ) // framerate
write_byte( 2 ) // life
write_byte( 20 ) // width
write_byte( 30 ) // noise
write_byte( 200 ) // r, g, b
write_byte( 200 ) // r, g, b
write_byte( 200 ) // r, g, b
write_byte( 200 ) // brightness
write_byte( 200 ) // speed
message_end()
//Sparks
message_begin( MSG_PVS, SVC_TEMPENTITY,vec2)
write_byte( 9 )
write_coord( vec2 )
write_coord( vec2 )
write_coord( vec2 )
message_end()
//Smoke
message_begin( MSG_BROADCAST,SVC_TEMPENTITY,vec2)
write_byte( 5 )
write_coord(vec2)
write_coord(vec2)
write_coord(vec2)
write_short( g_sModelIndexSmoke )
write_byte( 10 )
write_byte( 10 )
message_end()
}
public plugin_precache()
{
g_sModelIndexSmoke = precache_model("sprites/steam1.spr")
lightning = precache_model("sprites/lgtning.spr")
precache_sound( "ambience/thunder_clap.wav")
return PLUGIN_CONTINUE
} team_objectives 插件名字真多,功能差不多的吧,这个坛子里有 我下下来试试 我下下来试试 我下下来试试 我下下来试试 不过好像换下一个地图就没事了把。
页:
1
[2]