|
发表于 2008-3-7 09:29:27
|
显示全部楼层
|阅读模式
来自 中国–广东–佛山–三水区
这个是扔包处罚插件
但经测试,无论直接处死还是埋藏玩家都是只针对开局时的带包者!
若包被另外一个T捡到,他扔包是不会受到处罚的!
请问这个.sma可以修改为任何T扔包都会受到处罚?谢谢
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <fakemeta>
new index,cvar1,cvar2,cvar3,cvar4,cvar5;
new Float:start, Float:end, Float:burytime;
new origin[3];
public plugin_init()
{
register_plugin("Bomb Drop Slay","0.5","SweatyBanana");
register_dictionary("bombdict.txt")
// bomb status
// 1 - plugin on
// 0 - plugin off
cvar1 = register_cvar("bomb_status","1");
cvar2 = register_cvar("bomb_time","120.0");
cvar3 = register_cvar("bomb_punish","3");
cvar4 = register_cvar("bomb_slaphealth","50");
cvar5 = register_cvar("bomb_burytime","10.0");
if(engfunc(EngFunc_FindEntityByString, -1, "classname", "func_bomb_target") > 0)
{
register_logevent("f_spawned", 3, "2=Spawned_With_The_Bomb")
register_logevent("f_dropped", 3, "2=Dropped_The_Bomb")
}
}
public f_spawned()
{
if(get_pcvar_num(cvar1)==0)
return PLUGIN_HANDLED;
index = get_loguser_index();
start = get_gametime();
return PLUGIN_CONTINUE;
}
public f_dropped()
{
new user = get_loguser_index();
if(get_pcvar_num(cvar1)==0 || !is_user_alive(user))
return PLUGIN_HANDLED;
end = get_gametime();
if(user==index && end-start<=get_pcvar_float(cvar2))
{
f_punishuser(index);
}
return PLUGIN_CONTINUE;
}
public f_punishuser(index)
{
new punishment = get_pcvar_num(cvar3);
new starthealth = get_user_health(index);
new slaphealth = get_pcvar_num(cvar4);
burytime = get_pcvar_float(cvar5);
if(slaphealth<0 || burytime<0.0)
{
slaphealth = 50;
burytime = 10.0;
}
new Name[33];
get_user_name(index,Name,32);
set_hudmessage(255, 0, 0, -1.0, 0.0, 0, 6.0, 12.0);
switch(punishment)
{
case 1:
{
user_kill(index,0);
show_hudmessage(0,"%L",LANG_SERVER,"SLAY_U",Name);
}
case 2:
{
user_slap(index,slaphealth);
show_hudmessage(0,"%L",LANG_SERVER,"SLAP",Name,starthealth-slaphealth);
}
case 3:
{
set_task(0.1,"f_bury",index);
show_hudmessage(0,"%L",LANG_SERVER,"BURY",Name,floatround(burytime,floatround_floor));
}
}
}
public f_bury(index)
{
get_user_origin(index,origin);
origin[2] -= 50;
set_user_origin(index,origin);
set_task(burytime,"f_unbury",index);
}
public f_unbury(index)
{
get_user_origin(index,origin);
origin[2] += 50;
set_user_origin(index,origin);
client_print(index,print_chat,"%L",LANG_SERVER,"UNBURY");
}
stock get_loguser_index()
{
new loguser[80],name[32]
read_logargv(0,loguser,79)
parse_loguser(loguser,name,31)
return get_user_index(name)
} |
|