AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Change hud Sprites... (https://forums.alliedmods.net/showthread.php?t=86720)

One 03-01-2009 17:15

Change hud Sprites...
 
i found this plugin here: http://forums.alliedmods.net/showthr...sprite+players

PHP Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN_NAME "Team Icon Spr"
#define PLUGIN_VERSION "1.0.4"
#define PLUGIN_AUTHOR "tuty"

#define CT_SPRITE "sprites/teamspr/ct_blue.spr"
#define T_SPRITE "sprites/teamspr/t_red.spr"

new g_ct_blue_spr;
new 
g_t_red_spr;
new 
g_sprtime;
new 
g_plugin_mode;
new 
g_cvarvalue;

public 
plugin_init()
{
    
register_pluginPLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR );
    
register_event"DeathMsg""remove_spr""a" );
    
register_logevent"logevent_round_start"2"1=Round_Start" );
    
register_clcmd"say /teamspr""CreateSprite" );
    
register_clcmd"say_team /teamspr""CreateSprite" );
    
register_clcmd"say /delspr""RemoveSprite" );
    
register_clcmd"say_team /delspr""RemoveSprite" );
    
g_sprtime register_cvar"teamspr_sprite_time""32767" );
    
g_plugin_mode register_cvar"teamspr_mode""1" );
    
register_dictionary"teamspr.txt" );
}
public 
plugin_precache()
{
    
g_ct_blue_spr precache_modelCT_SPRITE );
    
g_t_red_spr precache_modelT_SPRITE );
}
public 
logevent_round_start()
{
    
g_cvarvalue get_pcvar_numg_plugin_mode );
    new 
players32 ], numi;
    
get_playersplayersnum );
    for( 
0numi++ ) 
    {
        if( !
is_user_aliveplayers] ) )
            continue;
        
        switch( 
g_cvarvalue )
        {
            case 
0: return PLUGIN_HANDLED;
            case 
1Removeplayers] );
            case 
2:
            {
                
message_beginMSG_ALLSVC_TEMPENTITY );
                
write_byteTE_PLAYERATTACHMENT );
                
write_byteplayers] );
                
write_coord45 );
                
write_short( ( get_user_teamplayers] ) == ) ? g_t_red_spr g_ct_blue_spr ); 
                
write_shortget_pcvar_numg_sprtime ) );
                
message_end();
            }
        }
    }
    return 
PLUGIN_CONTINUE;
}
public 
CreateSpriteid )
{
    
g_cvarvalue get_pcvar_numg_plugin_mode );
    if( 
g_cvarvalue == )
    {
        
client_printidprint_chat"%L"id"CANNOT_CREATE" );
        
client_cmdid"speak buttons/blip1.wav" );
        
Removeid );
        return 
PLUGIN_HANDLED;
    }
    else if( 
g_cvarvalue != )
    {
        
client_printidprint_chat"%L"id"ALLREADY_HAVE" );
        
client_cmdid"speak buttons/blip1.wav" );
        return 
PLUGIN_HANDLED;
    }
    
message_beginMSG_ALLSVC_TEMPENTITY );
    
write_byteTE_PLAYERATTACHMENT );
    
write_byteid );
    
write_coord45 );
    
write_short( ( get_user_teamid ) == ) ? g_t_red_spr g_ct_blue_spr ); 
    
write_shortget_pcvar_numg_sprtime ) );
    
message_end();
    
    
client_printidprint_chat"%L"id"SUCCESSFULLY_CREATED" );
    
client_cmdid"speak fvox/activated.wav" );
    return 
PLUGIN_CONTINUE;
}
public 
RemoveSpriteid )
{
    
g_cvarvalue get_pcvar_numg_plugin_mode );
    if( 
g_cvarvalue == )
    {
        
client_printidprint_chat"%L"id"CANNOT_CREATE" );
        
client_cmdid"speak buttons/blip1.wav" );
        return 
PLUGIN_HANDLED;
    }
    else if( 
g_cvarvalue != )
    {
        
client_printidprint_chat"%L"id"MUST_STAY_UP" );
        
client_cmdid"speak buttons/blip1.wav" );
        return 
PLUGIN_HANDLED;
    }    
    
Removeid );
    
client_printidprint_chat"%L"id"SUCCESSFULLY_DELETED" );
    
client_cmdid"speak fvox/deactivated.wav" );
    return 
PLUGIN_CONTINUE;
}
public 
remove_spr()
{
    
Removeread_data) );
    return 
PLUGIN_CONTINUE;
}
Removeindex )
{
    
message_beginMSG_ALLSVC_TEMPENTITY );
    
write_byteTE_KILLPLAYERATTACHMENTS );
    
write_byteindex );
    
message_end();
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/ 

i thinked when we can replace the speak icone with another icons,why we cant replace a hud icone?

i posted this in script help cuz, idk when its poss. how can i change this?!
& 2. question : is this poss. to make it in fakemeta?

Arkshine 03-01-2009 17:24

Re: Change hud Sprites...
 
Not possible, it's client-side.

BOYSplayCS 03-01-2009 17:25

Re: Change hud Sprites...
 
This is impossible.

Edit: Arkshine beat me to it.

padilha007 03-01-2009 18:19

Re: Change hud Sprites...
 
you can explain BOYSplayCS?

BOYSplayCS 03-01-2009 19:53

Re: Change hud Sprites...
 
Because hud icons are completely client-side and cannot be changed by using AMXX. The only way you could accomplish what you want is to hack the users files and install and upload the sprite. Which also, cannot be done with AMXX.

BOYSplayCS 03-01-2009 19:54

Re: Change hud Sprites...
 
Users can change their hud sprites by using the site fpsbanana.com and following the step-by-step tutorial.

One 03-02-2009 04:12

Re: Change hud Sprites...
 
1 Attachment(s)
Hm... Ty all for answers....u know i cant understand why its not possible cuz the players has only download the sprites...can anyone say me more details for this?this is anything like models...player have just to download the models & this will all be replaced on the server.i dont think that this is a hack or ...

here the code that i tried. ( not testet cuz im @ School )
PHP Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN_NAME "hud spr test"
#define PLUGIN_VERSION "1"
#define PLUGIN_AUTHOR "one"

#define hud_SPRITE "sprites/640hud72134.spr"

new g_ct_blue_spr;
new 
g_t_red_spr;
new 
g_plugin_mode;
new 
g_cvarvalue;

public 
plugin_init()
{
    
register_pluginPLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR );
    
register_event"DeathMsg""remove_spr""a" );
    
register_logevent"logevent_round_start"2"1=Round_Start" );
    
g_plugin_mode register_cvar"teamspr_mode""1" );

}
public 
plugin_precache()
{
    
g_ct_blue_spr precache_modelhud_SPRITE );

}
public 
logevent_round_start()
{
    
g_cvarvalue get_pcvar_numg_plugin_mode );
    new 
players32 ], numi;
    
get_playersplayersnum );
    for( 
0numi++ ) 
    {
        if( !
is_user_aliveplayers] ) )
            continue;
        
        switch( 
g_cvarvalue )
        {
            case 
0: return PLUGIN_HANDLED;
            case 
1Removeplayers] );
            case 
2:
            {
                
message_beginMSG_ALLSVC_TEMPENTITY );
                
write_byteTE_PLAYERATTACHMENT );
                
write_byteplayers] );
                
write_coord45 );
                
write_short( ( get_user_teamplayers] ) == ) ? g_t_red_spr g_ct_blue_spr ); 
                
message_end();
            }
        }
    }
    return 
PLUGIN_CONTINUE;
}
public 
CreateSpriteid )
{
    
g_cvarvalue get_pcvar_numg_plugin_mode );
    if( 
g_cvarvalue == )
    {
        
client_printidprint_chat"%L"id"CANNOT_CREATE" );
        
client_cmdid"speak buttons/blip1.wav" );
        
Removeid );
        return 
PLUGIN_HANDLED;
    }
    else if( 
g_cvarvalue != )
    {
        
client_printidprint_chat"%L"id"ALLREADY_HAVE" );
        
client_cmdid"speak buttons/blip1.wav" );
        return 
PLUGIN_HANDLED;
    }
    
message_beginMSG_ALLSVC_TEMPENTITY );
    
write_byteTE_PLAYERATTACHMENT );
    
write_byteid );
    
write_coord45 );
    
write_short( ( get_user_teamid ) == ) ? g_t_red_spr g_ct_blue_spr ); 
    
message_end();
    
    
client_printidprint_chat"%L"id"SUCCESSFULLY_CREATED" );
    
client_cmdid"speak fvox/activated.wav" );
    return 
PLUGIN_CONTINUE;
}
public 
RemoveSpriteid )
{
    
g_cvarvalue get_pcvar_numg_plugin_mode );
    if( 
g_cvarvalue == )
    {
        
client_printidprint_chat"%L"id"CANNOT_CREATE" );
        
client_cmdid"speak buttons/blip1.wav" );
        return 
PLUGIN_HANDLED;
    }
    else if( 
g_cvarvalue != )
    {
        
client_printidprint_chat"%L"id"MUST_STAY_UP" );
        
client_cmdid"speak buttons/blip1.wav" );
        return 
PLUGIN_HANDLED;
    }    
    
Removeid );
    
client_printidprint_chat"%L"id"SUCCESSFULLY_DELETED" );
    
client_cmdid"speak fvox/deactivated.wav" );
    return 
PLUGIN_CONTINUE;
}
public 
remove_spr()
{
    
Removeread_data) );
    return 
PLUGIN_CONTINUE;
}
Removeindex )
{
    
message_beginMSG_ALLSVC_TEMPENTITY );
    
write_byteTE_KILLPLAYERATTACHMENTS );
    
write_byteindex );
    }
/* Plugin generated by AMXX-Studio */ 

sprite + hud pic attached.

http://image.hazardstrip.com/ss/guis/thm_11837.jpg

if u wanna try this just rename the sprite file to 640hud7.spr & copy in sprites folder. its only 1 sprite file :(

Please give me more info...i found no doc for this


All times are GMT -4. The time now is 16:53.

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