Raised This Month: $ Target: $400
 0% 

[Help] Game name change whenever we want


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 02-20-2016 , 19:39   Re: [Help] Game name change whenever we want
Reply With Quote #2

Code:
#define UPDATE_TIME 1.0
#define ENTITY_CLASS "env_host_timeleft"
 
new g_szHostname[ 64 ];
new g_pointerHostname,g_MsgServerName
 
public plugin_init()
{
   set_task( 2.5, "checkTimeleft" );
}
 
public checkTimeleft( ) 
{
 get_pcvar_string( g_pointerHostname, g_szHostname, 63 );
 
 register_think( ENTITY_CLASS, "fwdThink_Updater" );
 new iEntityTimer = create_entity( "info_target" );
 entity_set_string( iEntityTimer, EV_SZ_classname, ENTITY_CLASS );
 entity_set_float( iEntityTimer, EV_FL_nextthink, get_gametime() + UPDATE_TIME );
}
public fwdThink_Updater( iEntity ) 
{
 static szHostname[ 64 ]
 formatex( szHostname, 63, "%s ADD_HERE_THE_NAME", g_szHostname)  
 
 set_pcvar_string( g_pointerHostname, szHostname );
 
 message_begin( MSG_BROADCAST, g_MsgServerName );
 write_string( szHostname );
 message_end( );
 
 entity_set_float( iEntity, EV_FL_nextthink, get_gametime() + UPDATE_TIME );
 return PLUGIN_CONTINUE;
}

Last edited by EFFx; 02-20-2016 at 19:40.
EFFx is offline
 



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 09:23.


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