So,i want to modify the code to show /me only when dead based on sayme plugin, is this code ok with this modification or what is the right way?
thanks
Код:
#define NOT_ALIVE
GetStats(id, GetStatsFunctions:type)
{
if(!is_user_connected(id)) continue;
#if defined NOT_ALIVE
if(is_user_alive(id))
{
client_print_color(id, print_team_default, "^1[^3Say-Me^1] You have to be ^3dead ^1to use this!");
return PLUGIN_HANDLED;
}
#endif
switch(type)
{
case StatsMe:
{
new st[ARRSIZE_STATS], bh[ARRSIZE_BODY];
if(get_user_rstats(id, st, bh) && st[DAMAGE])
{
new szFormat[190], len = formatex(szFormat, charsmax(szFormat), "^1[^4Say-Me^1] ^4You made ^3%d ^4dmg >> ", st[DAMAGE]);
for(new i; i < sizeof g_arrBodyMeParts; ++i)
{
if(bh[i])
{
len += formatex(szFormat[len], charsmax(szFormat) - len, "^3%s^1: ^4%d^1, ", g_arrBodyMeParts[i], bh[i]);
}
}
szFormat[strlen(szFormat) - 2] = EOS;
client_print_color(id, print_team_default, szFormat);
}
else client_print_color(id, print_team_default, "^1[^4Say-Me^1] ^4You ^3didin't hit ^4anyone!");
...