Raised This Month: $ Target: $400
 0% 

Changing roundtime so it takes effect ATM


Post New Thread Reply   
 
Thread Tools Display Modes
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-29-2015 , 08:57   Re: Changing roundtime so it takes effect ATM
Reply With Quote #21

Then you do something wrong.
__________________
Arkshine is offline
Rirre
Veteran Member
Join Date: Nov 2006
Old 10-29-2015 , 09:15   Re: Changing roundtime so it takes effect ATM
Reply With Quote #22

Well do you see anything wrong here then?

server console:
Code:
Parsing functions stated.
	Parsing file "InstallGameRules" started
		Return type "CHalfLifeMultiplayer *" validated
		Searching for name "InstallGameRules_Fv"... FOUND
	Parsing file "InstallGameRules" ended
Parsing functions ended.
configs/orpheu/memory/CGameRulesOffsets:
Code:
[     //...     {         "name"        : "m_flRoundCount",         "type"        : "long",         "memoryType"  : "data",         "identifiers" :         [             {                 "os"    : "windows",                 "mod"   : "cstrike",                 "value" : 56             },             {                 "os"    : "linux",                 "mod"   : "cstrike",                 "value" : 48             }         ]     },     {         "name"        : "m_iRoundTimeSecs",         "type"        : "int",         "memoryType"  : "data",         "identifiers" :         [             {                 "os"    : "windows",                 "mod"   : "cstrike",                 "value" : 64             },             {                 "os"    : "linux",                 "mod"   : "cstrike",                 "value" : 52             }         ]     },     //... ]
Code:
#include <amxmodx> #include <orpheu> #include <orpheu_memory> #define PLUGIN  "Fix RoundTimer" #define AUTHOR  "Rirre/Arkshine" #define VERSION "1.1" enum GameRulesMembers {     m_iRoundTimeSecs,     m_flRoundCount }; new const GameRulesMI[ GameRulesMembers ][] = {     "m_iRoundTimeSecs",     "m_flRoundCount" };     new g_pGameRules; new g_c4timer, mp_c4timer; #define set_mp_pdata(%1,%2)  ( OrpheuMemorySetAtAddress( g_pGameRules, GameRulesMI[ %1 ], 1, %2 ) ) #define get_mp_pdata(%1)     ( OrpheuMemoryGetAtAddress( g_pGameRules, GameRulesMI[ %1 ] ) ) public plugin_precache() OrpheuRegisterHook( OrpheuGetFunction( "InstallGameRules" ), "OnInstallGameRules", OrpheuHookPost ); public OnInstallGameRules() g_pGameRules = OrpheuGetReturn(); public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR);     register_logevent("PlantedBomb", 3, "2=Planted_The_Bomb");     mp_c4timer = get_cvar_pointer("mp_c4timer"); } public plugin_cfg() g_c4timer = get_pcvar_num(mp_c4timer); public PlantedBomb() setRoundTime( g_c4timer ); setRoundTime( const newTime ) {     set_mp_pdata( m_iRoundTimeSecs, newTime );     set_mp_pdata( m_flRoundCount, get_gametime() );         static msgIndexRoundTime;         if( msgIndexRoundTime || ( msgIndexRoundTime = get_user_msgid( "RoundTime" ) ) )     {         message_begin( MSG_ALL, msgIndexRoundTime );         write_short( newTime );         message_end();     } }

Last edited by Rirre; 10-29-2015 at 10:36.
Rirre is offline
WaLkMaN
Senior Member
Join Date: Oct 2010
Location: Varna, Bulgaria
Old 04-22-2023 , 05:25   Re: Changing roundtime so it takes effect ATM
Reply With Quote #23

With ReAPI:

Code:
#include <amxmodx> #include <reapi> new const PluginName   [] = "Set Round Time"; new const PluginVersion[] = "1.0"; new const PluginAuthor [] = "Arkshine"; const YourRoundTimeValue = 5 * 60; // 5 min in seconds. public plugin_init() {     register_plugin( PluginName, PluginVersion, PluginAuthor );     register_clcmd( "say /resettime", "ClientCommand_ResetRoundTime" ); } public ClientCommand_ResetRoundTime( const client ) {     setRoundTime( YourRoundTimeValue );     return PLUGIN_HANDLED; } setRoundTime( const newTime ) {     set_member_game( m_iRoundTimeSecs, newTime );     set_member_game( m_fRoundStartTime, get_gametime() ); // deprecated name m_fRoundCount in ReGameDLL_CS         static msgIndexRoundTime;         if( msgIndexRoundTime || ( msgIndexRoundTime = get_user_msgid( "RoundTime" ) ) )     {         message_begin( MSG_ALL, msgIndexRoundTime );         write_short( newTime );         message_end();     } }
__________________

Last edited by WaLkMaN; 04-22-2023 at 05:26.
WaLkMaN 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 10:31.


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