If player is dead, ofcourse his health & armor is 0, you should add alive check
PHP Code:
#include <amxmodx>
#define PLUGIN "Aboutme"
#define VERSION "1.0"
#define AUTHOR "xer'"
public plugin_init() {
register_plugin( PLUGIN, VERSION, AUTHOR );
register_clcmd("say /aboutme", "cmdAboutMe");
register_clcmd("say_team /aboutme", "cmdAboutMe");
set_task( 30.0, "fnInformation", _, _, _, "b" );
}
public cmdAboutMe( id ) {
new szName[ 32 ], szIp[ 16 ], szSteamID[ 32 ], iPing, iLoss;
get_user_name( id, szName, 31 );
get_user_ip( id, szIp, 31, 1 );
get_user_authid( id, szSteamID, 31 );
get_user_ping( id, iPing, iLoss );
client_print( id, print_chat, "* Your name is %s. Your ip is: %s. Your steamid is: %s", szName, szIp, szSteamID );
if( is_user_alive( id ) )
client_print( id, print_chat, "* Your Health: %d. Your armor: %d. Your Frags: %d. Your deaths: %d. Your ping: %d", get_user_health( id ), get_user_armor( id ), get_user_frags( id ), get_user_deaths( id ), iPing );
else
client_print( id, print_chat, "* Your Frags: %d. Your deaths: %d. Your ping: %d", get_user_frags( id ), get_user_deaths( id ), iPing );
return PLUGIN_HANDLED;
}
public fnInformation() {
client_print( 0, print_chat, "To see live data about you, type in chat /aboutme" );
}
__________________