Raised This Month: $32 Target: $400
 8% 

Spectator Hud Information


Post New Thread Reply   
 
Thread Tools Display Modes
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 05-16-2011 , 18:55   Re: Spectator Hud Information
Reply With Quote #11

@ K.K.L.V

statsx has nothing to do with this plugin o.o

Nice plugin Connor.
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 05-17-2011 , 04:51   Re: Spectator Hud Information
Reply With Quote #12

you can modity the statsx code what you want !
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
Se7ven
Senior Member
Join Date: Feb 2011
Location: Romania
Old 05-17-2011 , 06:40   Re: Spectator Hud Information
Reply With Quote #13

You can do an update
You can put the bullets from the gun which he is having in arms.
__________________
WwW.HighCS.Ro From Romania For You
Se7ven is offline
Send a message via AIM to Se7ven Send a message via Yahoo to Se7ven
FreZZy
Junior Member
Join Date: Apr 2011
Old 05-22-2011 , 08:52   Re: Spectator Hud Information
Reply With Quote #14

@FOUTA: try this one:

PHP Code:
/*    Formatright © 2010, ConnorMcLeod

    This plugin is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this plugin; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
#include <engine>

#define VERSION "0.0.1"
#define PLUGIN "Spectator Hud Informations"

#define MAX_PLAYERS        32
#define FIRST_PERSON_VIEW 4

new const g_iWeaponIdToAmmoId[] = {
        
090212514641310764446101103541021184207}
        
new 
g_iHealth[MAX_PLAYERS+1]
new 
g_iArmor[MAX_PLAYERS+1]
//new g_iMoney[MAX_PLAYERS+1]
new g_iCurWeapon[MAX_PLAYERS+1]
new 
g_iAmmo[MAX_PLAYERS+1]
new 
g_iBpAmmo[MAX_PLAYERS+1][15]

new 
g_dhud_color

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")

    
register_cvar("amx_spec_hud_color""250 250 250")

    
//register_event("Money", "Event_Money", "b")
    
register_event("CurWeapon""Event_CurWeapon""b""1=1")
    
register_event("Health""Event_Health""b")
    
register_event("Battery""Event_Battery""b")
    
register_event("AmmoX""Event_AmmoX""b""1<15")

    new 
szColor[12], szRed[4], szGreen[4], szBlue[4], rgb
    get_cvar_string
("amx_spec_hud_color"szColorcharsmax(szColor))
    
parse(szColorszRedcharsmax(szRed), szGreencharsmax(szGreen), szBluecharsmax(szBlue))
    
clampstr_to_num(szRed), 0255)
    
clampstr_to_num(szGreen), 0255)
    
clampstr_to_num(szBlue), 0255)
    
g_dhud_color + ( << ) + ( << 16 )

    new 
iEnt create_entity("info_target")
    if( 
iEnt )
    {
        
entity_set_float(iEntEV_FL_nextthinkget_gametime() + 0.1)
        
entity_set_string(iEntEV_SZ_classname"_hud_spec")
        
register_think("_hud_spec""UpdateSpecHud")
    }
    else
    {
        
set_task(0.1"UpdateSpecHud", .flags="b")
    }
}

public 
UpdateSpecHudiEnt )
{
    if( 
iEnt )
    {
        
entity_set_float(iEntEV_FL_nextthinkget_gametime() + 0.1)
    }
    static 
iAlivePlayers[32], iDeadPlayers[32], iAliveCountiDeadCountiAlivePlayeriDeadPlayeri
    
static iAmmo
    
static bool:bRetrievedValuesszMessage1[128], szMessage2[128], iLen1iLen2
    get_players
(iAlivePlayersiAliveCount"a")
    if( !
iAliveCount )
    {
        return
    }
    
get_players(iDeadPlayersiDeadCount"bch")
    if( !
iDeadCount )
    {
        return
    }

    for(--
iAliveCountiAliveCount>=0iAliveCount--)
    {
        
bRetrievedValues false
        iAlivePlayer 
iAlivePlayers[iAliveCount]
        for(
i=0i<iDeadCounti++)
        {
            
iDeadPlayer iDeadPlayers[i]
            if( 
entity_get_int(iDeadPlayerEV_INT_iuser2) == iAlivePlayer && entity_get_int(iDeadPlayerEV_INT_iuser1) == FIRST_PERSON_VIEW )
            {
                if( !
bRetrievedValues )
                {
                    
iLen1 31formatex(szMessage1charsmax(szMessage1), "%3d HP^t^t^t%3d AP"g_iHealth[iAlivePlayer], g_iArmor[iAlivePlayer])
                    
iAmmo g_iAmmo[iAlivePlayer]
                    if( 
iAmmo != -)
                    {
                        
iLen2 31 formatex(
                                        
szMessage2charsmax(szMessage2), 
                                        
"%3d|%3d"
                                        
iAmmog_iBpAmmo[iAlivePlayer][  g_iWeaponIdToAmmoIdg_iCurWeapon[iAlivePlayer] ]  ]
                                        )
                    }
                    
/*else
                    {
                        iLen2 = 31 + formatex(szMessage2, charsmax(szMessage2), "$ %5d^n", g_iMoney[iAlivePlayer])
                    }*/
                    
bRetrievedValues true
                
}

                
__show__dhudmessage(iDeadPlayerszMessage1iLen1_:0.01_:0.98)
                
__show__dhudmessage(iDeadPlayerszMessage2iLen2_:0.92_:0.93)

                
iDeadPlayers[i--] = iDeadPlayers[--iDeadCount]
                if( !
iDeadCount )
                {
                    return
                }
            }
        }
    }
}

/*public Event_Money( id )
{
    g_iMoney[id] = read_data(1)
}*/

public Event_CurWeapon(id)
{
    
g_iCurWeapon[id] = read_data(2)
    
g_iAmmo[id] = read_data(3)
}

public 
Event_AmmoX(id)
{
    
g_iBpAmmo[id][read_data(1)] = read_data(2)
}

public 
Event_Health(id)
{
    
g_iHealth[id] = read_data(1)
}

public 
Event_Battery(id)
{
    
g_iArmor[id] = read_data(1)
}

// code extracted from Director Hud Message include file
// http://forums.alliedmods.net/showthread.php?t=149210
__show__dhudmessage(id, const szMessage[], iLenxy)
{
    
message_beginMSG_ONE_UNRELIABLE SVC_DIRECTOR, .player=id )
    {
        
write_byteiLen )
        
write_byteDRC_CMD_MESSAGE )
        
write_byte)
        
write_longg_dhud_color )
        
write_long)
        
write_long)
        
write_long0x38D1B717 )
        
write_long0x38D1B717 )
        
write_long0x3DF5C28F )
        
write_long)
        
write_stringszMessage )
    }
    
message_end()


Last edited by FreZZy; 05-26-2011 at 15:11. Reason: code in another way
FreZZy is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-22-2011 , 13:05   Re: Spectator Hud Information
Reply With Quote #15

Quote:
Originally Posted by FreZZy View Post
@FOUTA: try this one:
Please learn code first
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
sun0f4s0n
Junior Member
Join Date: Feb 2010
Old 05-24-2011 , 07:50   Re: Spectator Hud Information
Reply With Quote #16

Gj thx 4 share ! I use it on my server !
sun0f4s0n is offline
Shadymn
Senior Member
Join Date: Sep 2010
Old 05-26-2011 , 01:59   Re: Spectator Hud Information
Reply With Quote #17

is it working all right? after i put in my server, my server crashed.
Shadymn is offline
FreZZy
Junior Member
Join Date: Apr 2011
Old 05-26-2011 , 15:10   Re: Spectator Hud Information
Reply With Quote #18

Quote:
Originally Posted by ConnorMcLeod View Post
Please learn code first
yea, im trying to do so

so tell me p l e a s e, how do remake this shit -.-
FreZZy is offline
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 06-03-2011 , 19:23   Re: Spectator Hud Information
Reply With Quote #19

Quote:
set_task(0.1, "UpdateSpecHud", .flags="b")
Can you explain this ?
__________________
Join US - custom Zombie Server - Custom Addons:



Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-03-2011 , 19:35   Re: Spectator Hud Information
Reply With Quote #20

It explicits the argument where you put usually the flags in set_task. "b" meaning infinite loop. It's the same writing : set_task( 0.1, "UpdateSpecHud", _, _, _, "b" ); or set_task( 0.1, "UpdateSpecHud", 0, "", 0, "b" );. To avoid to write that and since you use only the flags, you can explicit the argument name (name you find in the function header) using ".". You can do that because all the arguments here have a default value. You could type for example : set_task( 0.1, "Blabla", .id = 666, .flags = "a", .repeat = 5 );.
__________________

Last edited by Arkshine; 06-03-2011 at 19:40. Reason: vz
Arkshine is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:57.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode