Raised This Month: $ Target: $400
 0% 

Sprites/TGA on Hud


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Killer zm
Senior Member
Join Date: Jun 2011
Old 04-23-2012 , 08:28   Sprites/TGA on Hud
Reply With Quote #1

I search for an plugin to put on hud players sprites or tga. images. I found metahook module but is workin just on NON-STEAM, and i am thinking if can be made an plugin to do this to work on steam,
Then I found this plugin Addon : Sprites On HUD >> link : http://forums.alliedmods.net/showthread.php?t=159584

But sprites are not stable on the screen like radar for example when you move the sprite that is on the hud is moving and i am thinking if can be made to stay on the screen stable even if you moving.

And if anyoane can make an plugin like metahook to work on steam it will be great.

Last edited by Killer zm; 04-23-2012 at 08:29.
Killer zm is offline
csoldjb
Member
Join Date: Dec 2010
Old 04-23-2012 , 09:54   Re: Sprites/TGA on Hud
Reply With Quote #2

I think it is impossible if you don't add a hook with Client.dll(SlowHack?)
csoldjb is offline
Killer zm
Senior Member
Join Date: Jun 2011
Old 04-23-2012 , 10:32   Re: Sprites/TGA on Hud
Reply With Quote #3

but image can be put on screen?? (tga.)
Killer zm is offline
cFG
SourceMod Donor
Join Date: Aug 2009
Location: Poland, Łódź
Old 04-23-2012 , 11:54   Re: Sprites/TGA on Hud
Reply With Quote #4

Still waiting for moderator decision.
It's not best method at all, but..
__________________
HLXBans - worthy successor of AMXBans

Last edited by cFG; 04-23-2012 at 11:56.
cFG is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 04-24-2012 , 04:12   Re: Sprites/TGA on Hud
Reply With Quote #5

I wouldn't be very happy if something like that happened to my game... minimizing, calling batch files and restarting... not to mention that some antiviruses freak out over stuff like these and most people will freak out too and will screw it, kill the game and they'll screw their own game as well and never visit your server again... now tell me, does a few images on the screen are worth it ? NO.

So stop trying to mod this ancient game, just use what you've got and that's it, enjoy it. If you want more, get to Source, I'm sure that one can do it.
__________________

Last edited by Hunter-Digital; 04-24-2012 at 04:13.
Hunter-Digital is offline
Killer zm
Senior Member
Join Date: Jun 2011
Old 04-24-2012 , 09:02   Re: Sprites/TGA on Hud
Reply With Quote #6

I dont know how we get here but I want to let hud.txt how is it and talking about Addon Sprites On HUD made by abdul-rehman , because when you moving the sprie is not staying stable on hud and if can be fixed this it will be great.

Here is the code:
PHP Code:
/***************************************************************************\
            ====================================           
             * || [ZP] Sprites On HUD v1.1 || *
            ====================================
                *by @bdul!*

    -------------------
     *||DESCRIPTION||*
    -------------------

    This plugins allows you to display a sprite on a user's HUD display
    It also features an easy-to-use API natives include file
    Animated sprites are also supported
    
    ---------------
     *||CREDITS||*
    ---------------

    - MeRcyLeZZ -----------> For his awesome Zombie Plague Mod
    - Quim' / Conner ------> For helping me in vector calculations and
                 helping me with FM_AddToFullPack forward
    - Arkshine ------------> For helping me with animating sprites

    ------------------
     *||CHANGE LOG||*
    ------------------
    
    v1.0 ====> Initial Release
    v1.1 ====> Added support for animated sprites
    
\***************************************************************************/

#include <amxmodx>
#include <fakemeta>
#include <xs>

// Distance at which the sprite is placed from the users screen
// DO NOT EDIT UNNECESSARILY!
#define DISTANCE     12

new g_player_ent[33], g_bit_connected_userg_stop_frame[33]

// Connected players macros
#define player_is_connected(%1)        (g_bit_connected_user |=  (1 << (%1 & 31)))
#define player_disconnected(%1)        (g_bit_connected_user &= ~(1 << (%1 & 31)))
#define is_player_connected(%1)        ((1 <= %1 <= 32) && (g_bit_connected_user & (1 << (%1 & 31))))

public plugin_init() 
{
    
// Register the plugin and the main forward
    
register_plugin("[ZP] Addon: Sprites On HUD""1.0""@bdul!");
    
register_forward(FM_AddToFullPack"fm_add_to_fullpack"1)
}

public 
plugin_natives()
{
    
// Lets register some natives
    
register_native("zp_display_hud_sprite""native_display_hud_sprite"1)
    
register_native("zp_remove_hud_sprite""native_remove_hud_sprite"1)
}

public 
fm_add_to_fullpack(eseenthosthost_flagsplayerp_set)
{
    
// Valid player ?
    
if (!is_player_connected(host))
        return 
FMRES_IGNORED;
    
    
// Player haves a valid sprite entity
    
if (ent == g_player_ent[host])
    {
        static 
Float:origin[3], Float:forvec[3], Float:voffsets[3]
        
        
// Retrieve player's origin
        
pev(hostpev_originorigin)
        
pev(hostpev_view_ofsvoffsets)
        
xs_vec_add(originvoffsetsorigin)
        
        
// Get a forward vector in the direction of player's aim
        
velocity_by_aim(hostDISTANCEforvec)
        
        
// Set the sprite on the new origin
        
xs_vec_add(originforvecorigin)
        
engfunc(EngFunc_SetOriginentorigin)
        
set_es(esES_Originorigin)
        
        
// Make the sprite visible
        
set_es(esES_RenderModekRenderNormal)
        
set_es(esES_RenderAmt200)
        
        
// Sprite animation already stopped ?
        
if (!g_stop_frame[host])
            return 
FMRES_IGNORED
        
        
// Stop the animation at the desired frame
        
if (pev(entpev_frame) == g_stop_frame[host])
        {
            
set_pev(entpev_framerate0.0)
            
g_stop_frame[host] = 0
        
}
    }
    
    
// Stupid compiler !!
    
return FMRES_IGNORED
}

public 
client_putinserver(id)
{
    
// Player connected
    
player_is_connected(id)
    
    
// Marks bots as disconnected players (so sprites are'nt displayed to them)
    
if (is_user_bot(id)) player_disconnected(id)
    
    
// Remove sprite entity if present
    
if (pev_valid(g_player_ent[id]))
        
remove_sprite_entity(id)
}

public 
client_disconnect(id)
{
    
// Player disconnected
    
player_disconnected(id)
    
    
// Remove sprite entity if present
    
if (pev_valid(g_player_ent[id]))
        
remove_sprite_entity(id)
}

public 
native_display_hud_sprite(id, const sprite_name[], Float:sprite_sizesprite_stopframeFloat:sprite_framerate)
{
    
// Invalid player ?
    
if (!is_player_connected(id))
        return -
1;
    
    
// Already haves a sprite on his hud
    
if (g_player_ent[id])
        return -
1;
    
    
// Strings passed byref
    
param_convert(2)
    
    
// Invalid sprite ?
    
if (!sprite_name[0])
        return -
1;
    
    
// Create an entity for the player
    
g_player_ent[id] = engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"env_sprite"))
    
    
// Invalid entity ?
    
if (!pev_valid(g_player_ent[id]))
        return -
1;
    
    
// Set some basic properties
    
set_pev(g_player_ent[id], pev_takedamage0.0)
    
set_pev(g_player_ent[id], pev_solidSOLID_NOT)
    
set_pev(g_player_ent[id], pev_movetypeMOVETYPE_NONE)
    
    
// Set the sprite model
    
engfunc(EngFunc_SetModelg_player_ent[id], sprite_name)
    
    
// Set the rendering on the entity
    
set_pev(g_player_ent[id], pev_rendermodekRenderTransAlpha)
    
set_pev(g_player_ent[id], pev_renderamt0.0)
    
    
// Set the sprite size
    
set_pev(g_player_ent[id], pev_scalesprite_size)
    
    
// Update sprite's stopping frame
    
g_stop_frame[id] = sprite_stopframe
    
    
// Allow animation of sprite ?
    
if (g_stop_frame[id] && sprite_framerate 0.0)
    {
        
// Set the sprites animation time, framerate and stop frame
        
set_pev(g_player_ent[id], pev_animtimeget_gametime())
        
set_pev(g_player_ent[id], pev_frameratesprite_framerate)
        
        
// Spawn the sprite entity (necessary to play the sprite animations)
        
set_pev(g_player_ent[id], pev_spawnflagsSF_SPRITE_STARTON)
        
dllfunc(DLLFunc_Spawng_player_ent[id])
    }
    
    return 
g_player_ent[id];
}

public 
native_remove_hud_sprite(id)
{
    
// Invalid player ?
    
if (!is_player_connected(id))
        return -
1;
    
    
// Doesnt haves any sprite on his screen ?
    
if (!pev_valid(g_player_ent[id]))
        return -
1;
    
    
// Remove sprite entity
    
remove_sprite_entity(id)
    
    return 
1;
}

// Removes a sprite entity from world
remove_sprite_entity(id)
{
    
engfunc(EngFunc_RemoveEntityg_player_ent[id])
    
    
g_player_ent[id] = 0
    g_stop_frame
[id] = 0


Last edited by Killer zm; 04-24-2012 at 09:02.
Killer zm is offline
cFG
SourceMod Donor
Join Date: Aug 2009
Location: Poland, Łódź
Old 04-25-2012 , 17:02   Re: Sprites/TGA on Hud
Reply With Quote #7

Quote:
Originally Posted by Hunter-Digital View Post
I wouldn't be very happy if something like that happened to my game... minimizing, calling batch files and restarting... not to mention that some antiviruses freak out over stuff like these and most people will freak out too and will screw it, kill the game and they'll screw their own game as well and never visit your server again... now tell me, does a few images on the screen are worth it ? NO.

So stop trying to mod this ancient game, just use what you've got and that's it, enjoy it. If you want more, get to Source, I'm sure that one can do it.
nope, your argument is invalid, sir
source is a different game, i mean - physics sux, recoil sux, graphic sux(yup), gameplay sux
sourcemod nor sourceengine also does not provide such capabilities for modders(as far as i know)

You asked if it's worth - yes, it's totally worth working on and distibuting it.
You might as well not install the "x" program that beautifies your old windows theme with some new effects, because you're afraid that your computer explode. The risk is same.

You don't want to use "a few additional images on the screen" - as you said = you don't need to play on the server that has that possibility. Simple? Simple.
__________________
HLXBans - worthy successor of AMXBans

Last edited by cFG; 04-26-2012 at 07:08.
cFG is offline
Killer zm
Senior Member
Join Date: Jun 2011
Old 04-26-2012 , 09:59   Re: Sprites/TGA on Hud
Reply With Quote #8

ok if sprites is not working I am asking about .tga image on hud, that is possible? I am thinking how metahook is doing that.
Killer zm is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 04-26-2012 , 13:42   Re: Sprites/TGA on Hud
Reply With Quote #9

Quote:
Originally Posted by Killer zm View Post
ok if sprites is not working I am asking about .tga image on hud, that is possible? I am thinking how metahook is doing that.
Ask this guy he know that.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo 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 07:53.


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