Re: Shows weird name
Oh nono, there you go:
PHP Code:
in init:
register_event( "Damage", "eventDamage", "b" );
public eventDamage( ) { if( g_bKnifeHit ) { g_bKnifeHit = false; static victim; victim = g_HitData[iVictim]; if( !( 1 <= victim <= 32 ) ) { return PLUGIN_CONTINUE; } static attacker; attacker = g_HitData[iAttacker]; static Float:distance; distance = g_HitData[flDistance]; static Float:health; pev( victim, pev_health, health ); static r, g, b; GetHudColor( r, g, b ); static Float:x, Float:y; GetHudCoords( x, y ); set_hudmessage( r, g, b, x, y, 0, 0.0, get_pcvar_float( g_pCVarHudHoldtime ), 0.0, 0.0, 1 ); new szName[32]; if( g_HitData[iAttack] == STAB ) { show_hudmessage( attacker, "Stab Stats (%s)^nDistance: %f (max: 32.0)^nHit: %s (%s)^nDamage: %i"\ , g_szTraceType[TraceType:!g_HitData[iHitgroup]],\ distance, get_user_name(victim, szName, charsmax(szName)) ,\ g_szHitgroup[g_HitData[iHitgroup]], pev( victim, pev_dmg_take ) ); if( health < 0.0 ) { ColorChat( victim, BLUE, "[Knife Distance] %s stabbed you within %f units (%s)!",\ get_user_name(attacker, szName, charsmax(szName)) ,\ distance, g_szHitgroup[g_HitData[iHitgroup]] ); if( distance >= get_pcvar_float( g_pCVarSoundGodlikeStab ) ) { ColorChat( 0, RED, "[Knife Distance] %s stabbed %s within %f units (%s)!",\ get_user_name(attacker, szName, charsmax(szName)) , get_user_name(victim, szName, charsmax(szName)) ,\ distance, g_szHitgroup[g_HitData[iHitgroup]] ); client_cmd( 0, "spk %s", g_szSound[GODLIKE] ); } else if( distance >= get_pcvar_float( g_pCVarSoundWickedSickStab ) ) { ColorChat( 0, GREEN, "[Knife Distance] %s stabbed %s within %f units (%s)!",\ get_user_name(attacker, szName, charsmax(szName)) , get_user_name(victim, szName, charsmax(szName)) ,\ distance, g_szHitgroup[g_HitData[iHitgroup]] ); client_cmd( 0, "spk %s", g_szSound[WICKEDSICK] ); } } } else { show_hudmessage( attacker, "Slash Stats (%s)^nDistance: %f (max: 48.0)^nHit: %s (%s)^nDamage: %i"\ , g_szTraceType[TraceType:!g_HitData[iHitgroup]],\ distance, get_user_name(victim, szName, charsmax(szName)) ,\ g_szHitgroup[g_HitData[iHitgroup]], pev( victim, pev_dmg_take ) ); if( health < 0.0 ) { ColorChat( victim, BLUE, "[Knife Distance] %s slashed you within %f units (%s)!",\ get_user_name(attacker, szName, charsmax(szName)) ,\ distance, g_szHitgroup[g_HitData[iHitgroup]] ); if( distance >= get_pcvar_float( g_pCVarSoundGodlikeSlash ) ) { ColorChat( 0, RED, "[Knife Distance] %s slashed %s within %f units (%s)!",\ get_user_name(attacker, szName, charsmax(szName)) , get_user_name(victim, szName, charsmax(szName)) ,\ distance, g_szHitgroup[g_HitData[iHitgroup]] ); client_cmd( 0, "spk %s", g_szSound[GODLIKE] ); } else if( distance >= get_pcvar_float( g_pCVarSoundWickedSickSlash ) ) { ColorChat( 0, GREEN, "[Knife Distance] %s slashed %s within %f units (%s)!",\ get_user_name(attacker, szName, charsmax(szName)) , get_user_name(victim, szName, charsmax(szName)) ,\ distance, g_szHitgroup[g_HitData[iHitgroup]] ); client_cmd( 0, "spk %s", g_szSound[WICKEDSICK] ); } } } } return PLUGIN_CONTINUE; }
|