|
发表于 2012-4-9 10:18:26
|
显示全部楼层
来自 加拿大
我有源码 大家互相帮助
#include <amxmodx>
#include <fun>
#include <cstrike>
#define PLUGIN_NAME "Set Vip HP"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "lovehuai"
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
set_task(1.0,"run_check",422,"",0,"b")
}
public run_check(){
if (get_cvar_num("gg_replinishhealth")==0) return PLUGIN_CONTINUE
new players[32]
new i, numofplayers, id
get_players(players, numofplayers)
for (i=0; i<numofplayers; i++){
id=players
if (!is_user_alive(id)) continue
SetHp(id)
}
return PLUGIN_CONTINUE
}
public SetHp(id)
{
if(get_user_flags(id) & ADMIN_LEVEL_C)
{
new armor = (get_user_armor (id)) +5
new health = (get_user_health (id)) +5
if ( armor > 100) {
cs_set_user_armor(id, 100, CS_ARMOR_VESTHELM)
}
else {
cs_set_user_armor(id, armor, CS_ARMOR_VESTHELM)
}
if ( health > 100) {
set_user_health (id,100)
}
else {
set_user_health (id,health)
}
}
} |
|