|
发表于 2006-10-22 16:08:24
|
显示全部楼层
来自 中国–广东–潮州–湘桥区
回复: 求1.5 suicidetext.amxx插件
原先发的代码是直接从我自己的连杀奖励中皆出来的,谢谢zhangsheng共享suicidetext源码,
又学到几招
[php]
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Author"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("DeathMsg", "DeathMsg_Knife", "a")
}
public DeathMsg_Knife()
{
new kid,vid,tk,suicide
kid = read_data(1)
if( !kid )
return PLUGIN_CONTINUE
vid = read_data(2)
tk = ( get_user_team(kid) == get_user_team(vid) )?1:0
suicide = ( kid == vid ) ? 1:0
if( tk || suicide )
return PLUGIN_CONTINUE
new wpns[4]
read_data(4,wpns,3)
if( equal(wpns,"kni") )
{
new kname[32]
cs_set_user_money(kid, cs_get_user_money(kid)+8000, 1)//如果服务器金钱无限,请自行添加函数接口
get_user_name(kid, kname, 31)
client_print(0, print_center, "%s用刀杀敌,奖励金钱 8000", kname)
}
}
[/php] |
|