Post by Grit on Nov 20, 2016 15:40:16 GMT
Hi guy's
I'll provide first tutireal , ok here you are
*Note : This tutireal updated
search
put this script where you want in main code .sma
Then search :
it has this code :
replace all code ti this :
* Some screen shoots ;
[ID]
[Spectator]
I'll provide first tutireal , ok here you are
*Note : This tutireal updated
search
// Spectating someone else?
put this script where you want in main code .sma
public AddCommas( iNum , szOutput[] , iLen )
{
new szTmp[ 15 ] , iOutputPos , iNumPos , iNumLen;
if ( iNum < 0 )
{
szOutput[ iOutputPos++ ] = '-';
iNum = abs( iNum );
}
iNumLen = num_to_str( iNum , szTmp , charsmax( szTmp ) );
if ( iNumLen <= 3 )
{
iOutputPos += copy( szOutput[ iOutputPos ] , iLen , szTmp );
}
else
{
while ( ( iNumPos < iNumLen ) && ( iOutputPos < iLen ) )
{
szOutput[ iOutputPos++ ] = szTmp[ iNumPos++ ];
if( ( iNumLen - iNumPos ) && !( ( iNumLen - iNumPos ) % 3 ) )
szOutput[ iOutputPos++ ] = ',';
}
szOutput[ iOutputPos ] = EOS;
}
return iOutputPos;
}
Then search :
// Show HUD Task
it has this code :
// Show HUD Task
public ShowHUD(taskid)
{
static id
id = ID_SHOWHUD;
// Player died?
if (!g_isalive[id])
{
// Get spectating target
id = pev(id, PEV_SPEC_TARGET)
// Target not alive
if (!g_isalive[id]) return;
}
// Format classname
static class[32], red, green, blue
if (g_zombie[id]) // zombies
{
red = 250
green = 250
blue = 10
if (g_nemesis[id])
formatex(class, charsmax(class), "%L", ID_SHOWHUD, "CLASS_NEMESIS")
else if (g_assassin[id])
formatex(class, charsmax(class), "%L", ID_SHOWHUD, "CLASS_ASSASSIN")
else
copy(class, charsmax(class), g_zombie_classname[id])
}
else // humans
{
red = 0
green = 180
blue = 255
if (g_survivor[id])
formatex(class, charsmax(class), "%L", ID_SHOWHUD, "CLASS_SURVIVOR")
else if (g_sniper[id])
formatex(class, charsmax(class), "%L", ID_SHOWHUD, "CLASS_SNIPER")
else
formatex(class, charsmax(class), "%L", ID_SHOWHUD, "CLASS_HUMAN")
}
// Spectating someone else?
if (id != ID_SHOWHUD)
{
// Show name, health, class, and ammo packs and armor
set_hudmessage(255, 10, 255, HUD_SPECT_X, HUD_SPECT_Y, 1, 6.0, 1.1, 0.0, 0.0, -1)
ShowSyncHudMsg(ID_SHOWHUD, g_MsgSync2, "%L %s^nHP: %d - %L %s - %L %d - %L %d", ID_SHOWHUD, "SPECTATING", g_playername[id],
pev(id, pev_health), ID_SHOWHUD, "CLASS_CLASS", class, ID_SHOWHUD, "AMMO_PACKS1", g_ammopacks[id], ID_SHOWHUD, "ARMOR", pev(id, pev_armorvalue))
}
else
{
// Show health, class and ammo packs and armor
set_hudmessage(red, green, blue, HUD_STATS_X, HUD_STATS_Y, 0, 6.0, 1.1, 0.0, 0.0, -1)
ShowSyncHudMsg(ID_SHOWHUD, g_MsgSync2, "%L: %d - %L %s - %L %d - %L %d", id, "ZOMBIE_ATTRIB1", pev(ID_SHOWHUD, pev_health), ID_SHOWHUD, "CLASS_CLASS",
class, ID_SHOWHUD, "AMMO_PACKS1", g_ammopacks[ID_SHOWHUD], ID_SHOWHUD, "ARMOR", pev(ID_SHOWHUD, pev_armorvalue))
}
}
replace all code ti this :
// Show HUD Task
public ShowHUD(taskid)
{
static id
id = ID_SHOWHUD;
// Player died?
if (!g_isalive[id])
{
// Get spectating target
id = pev(id, PEV_SPEC_TARGET)
// Target not alive
if (!g_isalive[id]) return;
}
// Format classname
static class[32], red, green, blue
if (g_zombie[id]) // zombies
{
red = 250
green = 250
blue = 10
if (g_nemesis[id])
formatex(class, charsmax(class), "%L", ID_SHOWHUD, "CLASS_NEMESIS")
else if (g_assassin[id])
formatex(class, charsmax(class), "%L", ID_SHOWHUD, "CLASS_ASSASSIN")
else
copy(class, charsmax(class), g_zombie_classname[id])
}
else // humans
{
red = 0
green = 180
blue = 255
if (g_survivor[id])
formatex(class, charsmax(class), "%L", ID_SHOWHUD, "CLASS_SURVIVOR")
else if (g_sniper[id])
formatex(class, charsmax(class), "%L", ID_SHOWHUD, "CLASS_SNIPER")
else
formatex(class, charsmax(class), "%L", ID_SHOWHUD, "CLASS_HUMAN")
}
// Spectating someone else?
if (id != ID_SHOWHUD)
{
new szHP[ 15 ], szAP[ 15 ], szArmor[ 15 ]
AddCommas(pev(id, pev_health), szHP, charsmax(szHP))
AddCommas(g_ammopacks[id], szAP, charsmax(szAP))
AddCommas(pev(id, pev_armorvalue), szArmor, charsmax(szArmor))
// Show name, health, class, and ammo packs and armor
set_hudmessage(255, 10, 255, HUD_SPECT_X, HUD_SPECT_Y, 1, 6.0, 1.1, 0.0, 0.0, -1)
ShowSyncHudMsg(ID_SHOWHUD, g_MsgSync2, "%L %s^nHP: %s - %L %s - %L %s - %L %s", ID_SHOWHUD, "SPECTATING", g_playername[id],
szHP, ID_SHOWHUD, "CLASS_CLASS", class, ID_SHOWHUD, "AMMO_PACKS1", szAP, ID_SHOWHUD, "ARMOR", szArmor)
}
else
{
new szHP[ 15 ], szAP[ 15 ], szArmor[ 15 ]
AddCommas(pev(ID_SHOWHUD, pev_health), szHP, charsmax(szHP))
AddCommas(g_ammopacks[ID_SHOWHUD], szAP, charsmax(szAP))
AddCommas(pev(ID_SHOWHUD, pev_armorvalue), szArmor, charsmax(szArmor))
// Show health, class and ammo packs and armor
set_hudmessage(red, green, blue, HUD_STATS_X, HUD_STATS_Y, 0, 6.0, 1.1, 0.0, 0.0, -1)
ShowSyncHudMsg(ID_SHOWHUD, g_MsgSync2, "%L: %s - %L %s - %L %s - %L %s", id, "ZOMBIE_ATTRIB1", szHP, ID_SHOWHUD, "CLASS_CLASS",
class, ID_SHOWHUD, "AMMO_PACKS1", szAP, ID_SHOWHUD, "ARMOR", szArmor)
}
}
* Some screen shoots ;
[ID]
[Spectator]