Quote:
Originally Posted by mattiiias93
Liverwiz yes you understand me if someone aim on a person it will display. I had a code but not the start code can someone fix it? Thanks
new target, body;
get_user_aiming(id, target, body, 9999);
if( 0 < target <= gMaxPlayers && is_user_alive(target))
{
new sName[32], sMessage[64];
get_user_name(target, sName, 31);
if( cs_get_user_team(target) == cs_get_user_team(id) )
{
formatex(sMessage, 63, "Friend: %s^nHealth: %i", sName, get_user_health(target));
} else {
formatex(sMessage, 63, "Enemy: %s", sName);
}
if(cs_get_user_team(target) == CS_TEAM_CT)
set_hudmessage()// HUDMESSAGE_COLOR
} else if(cs_get_user_team(target) == CS_TEAM_T){
set_hudmessage()// HUDMESSAGE_COLOR
}
show_hudmessage(id, "%s", sMessage);
}
|
Do you have the rest of the code? What is gMaxPlayers defined as? and does the code even compile? That first if statement, i'm not sure is a valid expression. What "start code" do you need? You mean headers and init function?
Also....when you're posting code into a thread make sure to wrap "[CODE" "[/CODE" or "[PHP" "[/PHP" tags around it to preserve whitespace. NOTE: PHP tags preserve syntax highlighting, if you want it to look fancy.