|
发表于 2006-6-9 00:04:20
|
显示全部楼层
来自 中国–湖北–武汉
回复: 【求助】求一个可以设置所有玩家血值的CS1.5 AMXX插件!
[color="Blue"]这个很简单,看别人的源码与了解amxx一点点都可以编写。作为不好学的教训,以下源码收费才能看看。
[PHP]/* Plugin generated by AMXX-Studio */
/*
[参数]:
amx_allowhp <1 或 0> //是否允许改变HP
amx_resethp <整数:默认200> //设置玩家出生的HP值
*/
#include <amxmodx>
#include <fun>
#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Author"
//编译版本选项; 要在AMXX 1.70以下版本使用,去掉下面一行的注释
//#define USE_FOR_OLD_AMXX
#if !defined (USE_FOR_OLD_AMXX)
new g_allowhp
new g_resethp
#endif
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("ResetHUD", "player_spawn", "b")
#if !defined (USE_FOR_OLD_AMXX)
g_allowhp = register_cvar("amx_allowhp", "1")
g_resethp = register_cvar("amx_resethp", "200")
#else
register_cvar("amx_allowhp", "1")
register_cvar("amx_resethp", "200")
#endif
}
public player_spawn(id)
{
#if !defined (USE_FOR_OLD_AMXX)
if (!get_pcvar_num(g_allowhp))
{
#else
if (!get_cvar_num("amx_allowhp"))
{
#endif
return PLUGIN_CONTINUE
}
#if !defined (USE_FOR_OLD_AMXX)
set_user_health(id, get_pcvar_num(g_resethp))
#else
set_user_health(id, get_cvar_num("amx_resethp"))
#endif
return PLUGIN_CONTINUE
}
[/PHP] |
|