帮忙修改一下插件!
这个是扔包处罚插件但经测试,无论直接处死还是埋藏玩家都是只针对开局时的带包者!
若包被另外一个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;
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;
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 -= 50;
set_user_origin(index,origin);
set_task(burytime,"f_unbury",index);
}
public f_unbury(index)
{
get_user_origin(index,origin);
origin += 50;
set_user_origin(index,origin);
client_print(index,print_chat,"%L",LANG_SERVER,"UNBURY");
}
stock get_loguser_index()
{
new loguser,name
read_logargv(0,loguser,79)
parse_loguser(loguser,name,31)
return get_user_index(name)
}
回复: 帮忙修改一下插件!
你整的好雷。。。。直接取消放包丢包经验不就是了。回复: 帮忙修改一下插件!
可以的吗?修改那个参数?回复: 帮忙修改一下插件!
不让让他丢出C4就行了#include <amxmodx>
#include <amxmisc>
#define PLUGIN_NAME "New Plug-In"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "zwfgdlc"
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
//在此处添加您的代码...
}
public client_command(id)
{
new cmd,clip,ammo
read_argv(0,cmd,15)
if(equali(cmd,"drop"))
{
new wpnid=get_user_weapon(id,clip,ammo)
if(wpnid==CSW_C4)
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE
}
回复: 帮忙修改一下插件!
Post by zwfgdlc不让让他丢出C4就行了
#include <amxmodx>
#include <amxmisc>
#define PLUGIN_NAME "New Plug-In"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "zwfgdlc"
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
//在此处添加您的代码...
}
publ...
呵呵!刷包问题终于解决!非常感谢你的帮忙!
回复: 帮忙修改一下插件!
支持2楼冰河的观点,为了一个魔兽插件的BUG而放弃埋C4的任务,游戏也就显得不完整了,不可取啊!我建议你改一下war3ft的源代码吧,把捡包给予奖励的代码去掉就可以了,方法如下:首先找到amxmodx\scripting\war3ft这个文件夹,然后再分别打开里面的XP.h和XP.inl这两个文件。对于XP.h这个文件,删除里面的这句代码:
#define BOMB_PICKUP 10 // XP awarded when the user picks up the bomb
对于XP.inl这个文件,删除里面的这些代码:
// Picked up bomb
else if (equal(sAction,"Got_The_Bomb"))
{
g_iPlayerRole = PLR_BOMB_CARRIER;
new iBonusXP = XP_Give( id, BOMB_PICKUP );
if ( iBonusXP != 0 && get_pcvar_num( CVAR_wc3_show_objectives ) )
{
client_print( id, print_chat, "%s You have been awarded %d XP for picking up the bomb", g_MODclient, iBonusXP );
}
}
最后重新编译war3ft.sma应该就可以解决问题了。
回复: 帮忙修改一下插件!
嗯!好的!还是要多谢各位的大力帮助!回复: 帮忙修改一下插件!
对于这个问题,我觉得有两个解决方法:1. 找一个禁止背包的匪徒扔包的插件,即只允许埋包,而不能随便地扔包;2. 找一个当本回合结束时,禁止背包的匪徒在回合结束的延迟时间内扔包的插件。用到了上面的第1个方法,虽然不是很完美,但也不失为一个比较妥善的折中办法。总之,一切为了我们热爱的WAR3FT服务。
回复: 帮忙修改一下插件!
zwfgdlc的那个.sma就能很好地解决魔兽服刷包问题了!可以拿C4出来,就是不能扔,到了爆炸点才可以放包(本来就是)
这样再也不会出现刷包了!
回复: 帮忙修改一下插件!
改了下,在一局结局之前可以扔CR,当一方胜利后不可以扔,自己试下,没测试.<FONT style="BACKGROUND-COLOR: #f5f5ff">
#include <amxmodx>
#include <amxmisc>
#define PLUGIN_NAME "New Plug-In"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "zwfgdlc"
new bool:DropC4
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
register_event("SendAudio","event_round_end","a","2&%!MRAD_terwin","2&%!MRAD_ctwin")
register_logevent("RoundStart",2,"1=World triggered","2=Round_Start")
}
public client_command(id)
{
new cmd,clip,ammo
read_argv(0,cmd,15)
if(equali(cmd,"drop"))
{
new wpnid=get_user_weapon(id,clip,ammo)
if(wpnid==CSW_C4&&DropC4)
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE
}
public event_round_end()
{
DropC4=true
}
public RoundStart()
{
DropC4=false
}