 |
|
Veteran Member
Join Date: Jul 2011
Location: Belgium
|

01-21-2020
, 18:21
Re: COD: HitMarkers [First release: 16/01/2020]
|
#11
|
Quote:
Originally Posted by Bugsy
Not a functional improvement but you can reduce code:
PHP Code:
public PostTakeDamage(iVictim, iInflictor, iAttacker, Float:iDamage, iDamagebits)
{
new iRed, iGreen, iBlue;
if(get_pcvar_num(pPlugin) && is_user_connected(iAttacker) && (get_user_team(iVictim) != get_user_team(iAttacker)))
{
new iSnipersOnly = get_pcvar_num(pSnipersOnly);
if( ( iSnipersOnly && ( gWeaponList & (1 << get_user_weapon(iAttacker))) ) || !iSnipersOnly )
{
if(get_pcvar_num(pRainbow))
{
iRed = iRainbow;
iGreen = iRainbow;
iBlue = iRainbow;
}
else
{
iRed = get_pcvar_num(pColorRed);
iGreen = get_pcvar_num(pColorGreen);
iBlue = get_pcvar_num(pColorBlue);
}
set_hudmessage(iRed, iGreen, iBlue, get_pcvar_float(pXPosition), get_pcvar_float(pYPosition) , 0, 2.0, get_pcvar_float(pHoldTime) , 0.0, 0.0, -1);
show_hudmessage(iAttacker, "%s" , get_pcvar_num(pRandomHitmarkers) ? szSymbols[random(sizeof(szSymbols))] : "x");
}
}
}
|
Seriously you're a god, i would've never thought of using it that way. But should i use it? I mean my plugin wouldn't be my plugin anymore if i just use codes that get posted here. I would just be copying..
__________________
|
|
|
|