Raised This Month: $ Target: $400
 0% 

[Help] Game name change whenever we want


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BhK
Junior Member
Join Date: Dec 2014
Location: India
Old 01-17-2016 , 13:49   [Help] Game name change whenever we want
Reply With Quote #1

Hello!
as the title suggest how to change gamename from any function !
the code i have come so far ^^
PHP Code:
new game[45]
public 
plugin_init( )
    
register_forwardFM_GetGameDescription"GameDesc" ); 

public 
GameDesc( ) { 
        
forward_returnFMV_STRINGgame ); 
    return 
FMRES_SUPERCEDE
}  
public 
myFunction() {
       
formatex(game,sizeof game,"This is new name")
        new 
iReturn,iParams
    ExecuteForward
(FM_GetGameDescription,iReturn,iParams,iParams,iParams)

its not working !
__________________
Preparing to release my plugins..

Last edited by BhK; 01-18-2016 at 02:01.
BhK is offline
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
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 18:55.


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