Raised This Month: $51 Target: $400
 12% 

Round start Health by STEAM ID


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kirksite
Member
Join Date: Feb 2021
Old 04-18-2022 , 22:13   Round start Health by STEAM ID
Reply With Quote #1

I have googled and searched Allied Modders for a plugin that would allow a server to set round start health by STEAM ID and the closest I found was a handycap plugin. HAs this been done in the past and if not could it be done?

https://forums.alliedmods.net/showthread.php?t=15480
kirksite is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-18-2022 , 22:19   Re: Round start Health by STEAM ID
Reply With Quote #2

Of course it can be done. How do you want to define the steam-id's that get the higher health?
__________________
Bugsy is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 04-18-2022 , 23:18   Re: Round start Health by STEAM ID
Reply With Quote #3

Quote:
Originally Posted by kirksite View Post
I have googled and searched Allied Modders for a plugin that would allow a server to set round start health by STEAM ID and the closest I found was a handycap plugin. HAs this been done in the past and if not could it be done?

https://forums.alliedmods.net/showthread.php?t=15480
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>

#if !defined TrieGetSize
    
native TrieGetSizeTrie:handle )
#endif

#if !defined MAX_PLAYERS
    
const MAX_PLAYERS 32
#endif

#if !defined MAX_AUTHID_LENGTH
    
const MAX_AUTHID_LENGTH 64
#endif

enum _:PlayerHealth
{
    
Player_SteamIDMAX_AUTHID_LENGTH ],
    
Player_Health12 ]
}

new 
Trie:g_tHealtheDataPlayerHealth ], g_szSteamIDMAX_PLAYERS ][ MAX_AUTHID_LENGTH ];

public 
plugin_init( ) 
{
    
register_plugin"Hp by steamid""1.0""Supremache" )
    
    
RegisterHamHam_Spawn"player""OnPlayerSpawn")
    
    
g_tHealth TrieCreate( );
    
ReloadFile( );
}

public 
client_connectid )
{
    
get_user_authididg_szSteamIDid ], charsmaxg_szSteamID[ ] ) )
}

public 
plugin_end( )
{
    
TrieDestroyg_tHealth );
}

public 
OnPlayerSpawnid )
{
    if( !
is_user_aliveid ) )
    {
        return;
    }
    
    if( 
TrieGetArrayg_tHealthg_szSteamIDid ], eDatasizeof eData ) )
    {
        
set_pevidpev_healthstr_to_floateDataPlayer_Health ] ) )
    }

ReloadFile( )
{
    new 
g_szFile128 ]
    
    
get_configsdirg_szFilecharsmaxg_szFile ) );
    
addg_szFilecharsmaxg_szFile ), "/SteamHp.ini" )
    
    new 
iFile fopeng_szFile"rt" );
    
    if( 
iFile )
    {
        new 
szData96 ];
        
        while( 
fgetsiFileszDatacharsmaxszData ) ) )
        {    
            
trimszData );
            
            switch( 
szData] )
            {
                case 
EOS';''#''/': continue;
                default:
                {
                    
parseszDataeDataPlayer_SteamID ], charsmaxeDataPlayer_SteamID ] ), eDataPlayer_Health ], charsmaxeDataPlayer_Health ] ) ) 
                    
                    if( 
eDataPlayer_SteamID ][ ] )
                    {
                        
TrieSetArrayg_tHealtheDataPlayer_SteamID ], eDatasizeof eData );
                        
server_print"SteamID: %s, HP: %d"eDataPlayer_SteamID ], str_to_numeDataPlayer_Health ] ) )
                    }
                        
                    
arrayseteData0sizeofeData ) );
                }
            } 
        } 
        
fcloseiFile );
        
        if( 
TrieGetSizeg_tHealth ) )
        {
            
server_print"Loaded %d data from the file"TrieGetSizeg_tHealth ) )
        }
    }
    else
    {
        static 
szErr64 ];
        
formatexszErrcharsmaxszErr ), "The file %s doesn't exists" g_szFile );
        
set_fail_stateszErr );
    }

__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.

Last edited by Supremache; 04-21-2022 at 10:05.
Supremache is offline
kirksite
Member
Join Date: Feb 2021
Old 04-19-2022 , 15:32   Re: Round start Health by STEAM ID
Reply With Quote #4

Quote:
Originally Posted by Bugsy View Post
Of course it can be done. How do you want to define the steam-id's that get the higher health?

We have regulars who play at a level well above everyone else. I don't want to ban and I'm tired of requesting they "gun down". If I had the ability to handycap +/- 6 players by STEAM ID it would solve the problem and level the field.

Last edited by kirksite; 04-19-2022 at 15:40.
kirksite is offline
kirksite
Member
Join Date: Feb 2021
Old 04-19-2022 , 15:38   Re: Round start Health by STEAM ID
Reply With Quote #5

Supremache - each STEAM_ID is hard coded into the plugin?

Last edited by kirksite; 04-19-2022 at 15:39.
kirksite is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 04-19-2022 , 16:11   Re: Round start Health by STEAM ID
Reply With Quote #6

Quote:
Originally Posted by kirksite View Post
Supremache - each STEAM_ID is hard coded into the plugin?
What do you mean about hard coded ?!
Do u wanna a config file or command for adding steam id or what ?

Code:
{ "STEAM_ID_ONE", 100 }
It's works like: player with steam id 'STEAM_ID_ONE' will get 100 healths per respawn
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
kirksite
Member
Join Date: Feb 2021
Old 04-19-2022 , 16:16   Re: Round start Health by STEAM ID
Reply With Quote #7

Quote:
Originally Posted by Supremache View Post
What do you mean about hard coded ?!
Do u wanna a config file or command for adding steam id or what ?

Code:
{ "STEAM_ID_ONE", 100 }
It's works like: player with steam id 'STEAM_ID_ONE' will get 100 healths per respawn
kirksite is offline
kirksite
Member
Join Date: Feb 2021
Old 04-19-2022 , 16:17   Re: Round start Health by STEAM ID
Reply With Quote #8

a config file would probably be the simplest.
kirksite is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 04-19-2022 , 17:05   Re: Round start Health by STEAM ID
Reply With Quote #9

Try it now, file name 'SteamHp.ini'
It's works like: "SteamID" "Health"
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
kirksite
Member
Join Date: Feb 2021
Old 04-19-2022 , 17:52   Re: Round start Health by STEAM ID
Reply With Quote #10

No joy.
complied sma file and uploaded to /cstrike/addons/amxmodx/plugins
saved notepad SteamHP.ini file to /cstrike/addons/amxmodx/configs ("STEAM_0:1:269172" "80")

Hp by steamid 1.0 Supremache PlayerHealth.am running

Currently loaded modules:
name version author status
Fun 1.9.0.5294 AMX Mod X Dev Team running
Engine 1.9.0.5294 AMX Mod X Dev Team running
FakeMeta 1.9.0.5294 AMX Mod X Dev Team running
CStrike 1.9.0.5294 AMX Mod X Dev Team running
CSX 1.9.0.5294 AMX Mod X Dev Team running
Ham Sandwich 1.9.0.5294 AMX Mod X Dev Team running
MySQL 1.9.0.5294 AMX Mod X Dev Team running

Last edited by kirksite; 04-19-2022 at 17:53.
kirksite 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 02:29.


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