Okay, lets start.
1. I suggest a cvar for the visibility.
2. I don't think you need ".inc" in the #include.
Code:
#include <zombieplague> // should be enough
3.
Code:
if (get_user_health( id ) > get_pcvar_num( hplevel ) || zp_get_user_zombie(id))
{
return PLUGIN_CONTINUE
}
This won't help much, but it will help.
Code:
if (zp_get_user_zombie(id) || get_user_health( id ) > get_pcvar_num( hplevel ))
{
return PLUGIN_CONTINUE
}
4.
Code:
client_print(id, print_chat, "[ZP] Your health is below %d, you are now semi-invisible.", hplevel);
You printed the cvar pointer value, not the cvar value, lol.[/pawn]
5. I haven't tested, but it seems like the message will be displayed every time the player is hurt after the message has shown the first time.
6. I would do it like this:
Code:
#include <amxmodx>
#include <amxmisc>
#include <zombieplague>
#include <fun>
#define PLUGIN "Human HP Disguise"
#define VERSION "1.0"
#define AUTHOR "BOYSplayCS"
new hplevel // Amount of HP before turning Semi-Invisible.
new invisamount // Alpha amount for when player has become Semi-Invisible
new g_old_health[33];
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("Health", "EventHealth", "b");
hplevel = register_cvar("zp_disguise_health", "35");
invisamount = register_cvar("zp_disguise_alpha", "0");
}
public EventHealth(client)
{
new health = read_data(2);
if( health == g_old_health[client] ) return;
if( !zp_get_user_zombie(id) && health > 0 )
{
new disguise_amount = get_pcvar_num(hplevel);
if( health <= disguise_amount && g_old_health[client] > disguise_amount )
{
set_user_rendering(client, kRenderFxNone, 0, 0, 0, kRenderTransAdd, get_pcvar_num(invisamount));
client_print(client, print_chat, "[ZP] Your health is below %d, you are now semi-invisible.", disguise_amount);
}
}
g_old_health[client] = health;
}
Also, you can take these same suggestions for the "Normal" version.