Hi. In the Event_DeathMsg my Hud messages that I appear only at random.
Can someone help me out.
The server gives the HP correctly how I want it so I know that it is reading the code.
But for some reason that Huds only appear whenever they want too. I tried regular hud and now dhud but no difference.
PHP Code:
public Event_DeathMsg( )
{
new iKiller = read_data( 1 );
new iVictim = read_data( 2 );
new iHeadshot = read_data( 3 );
new iHSBonus = get_pcvar_num(p_HSKillBonus)
new iREGBonus = get_pcvar_num(p_RegularKillBonus)
if( iKiller && iVictim != iKiller )
{
new ServerMaxHP = get_pcvar_num( p_ServerMaxHp );
new UserOriginalHP = get_user_health( iKiller );
new szVictimName[ 32 ];
get_user_name( iVictim, szVictimName, 31 );
if( UserOriginalHP != ServerMaxHP )
{
if (iHeadshot && UserOriginalHP + iHSBonus < ServerMaxHP )
{
set_user_health( iKiller, UserOriginalHP + iHSBonus );
set_dhudmessage(0, 255, 100, -1.0, 0.15, 0, 1.0, 5.0, 0.1, 0.1)
show_dhudmessage(iKiller, "HEAD KILL: You have received en extra +%i HP for killing %s", iHSBonus, szVictimName)
}
else if ( UserOriginalHP + iREGBonus < ServerMaxHP )
{
set_user_health( iKiller, UserOriginalHP + iREGBonus );
set_dhudmessage(0, 255, 100, -1.0, 0.15, 0, 1.0, 5.0, 0.1, 0.1)
show_dhudmessage(iKiller, "You have received en extra +%i HP for Killing %s", iREGBonus, szVictimName)
}
else
{
set_user_health( iKiller, ServerMaxHP );
set_dhudmessage(0, 255, 100, -1.0, 0.15, 0, 1.0, 5.0, 0.1, 0.1)
show_dhudmessage(iKiller, "Your Health was set to the Servers Max HP Level of %i.", ServerMaxHP)
}
}
else
{
set_dhudmessage(0, 255, 100, -1.0, 0.15, 0, 1.0, 5.0, 0.1, 0.1)
show_dhudmessage(iKiller, "No Bonus HP: Already reached servers Max HP Limit of %i.", ServerMaxHP)
}
}
}
__________________