AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   HELP - HOSTNAME (https://forums.alliedmods.net/showthread.php?t=183534)

quark 04-22-2012 18:33

HELP - HOSTNAME
 
how can i change hostname without restart/changing map? Thanks.

kramesa 04-22-2012 18:35

Re: HELP - HOSTNAME
 
rcon hostname "Name"

oO

quark 04-22-2012 18:38

Re: HELP - HOSTNAME
 
With that i need to change map or restart server..

kramesa 04-22-2012 18:44

Re: HELP - HOSTNAME
 
Quote:

Originally Posted by quark (Post 1694785)
With that i need to change map or restart server..

Search... This is already made.

nikhilgupta345 04-22-2012 18:45

Re: HELP - HOSTNAME
 
Quote:

Originally Posted by quark (Post 1694785)
With that i need to change map or restart server..

No you don't. It changes the hostname, but if you're in the server and press TAB, it is still going to show the old hostname. However, if people see your server in the master list, they will see the updated hostname displayed. If you want it to change for the people that are already in the server, I believe you can send a ServerName message or something like that to have it updated.

kramesa 04-22-2012 18:46

Re: HELP - HOSTNAME
 
Code:
#include < amxmodx > #include < amxmisc > new g_pHostName, g_iMsgServerName; public plugin_init( ) {     register_plugin( "amx_hostname", "1.0", "xPaw" );         register_clcmd( "amx_hostname", "CmdHostName", ADMIN_CFG, "<hostname>" );         g_iMsgServerName = get_user_msgid( "ServerName" );     g_pHostName      = get_cvar_pointer( "hostname" ); } public CmdHostName( const id, const iLevel, const iCid ) {     if( !cmd_access( id, iLevel, iCid, 1 ) )         return PLUGIN_HANDLED;         new szHostName[ 64 ];         if( read_argc( ) == 1 ) {         console_print( id, "[AMXX] Hostname has been updated." );                 get_pcvar_string( g_pHostName, szHostName, 63 );     } else {         read_argv( 1, szHostName, 63 );                 set_pcvar_string( g_pHostName, szHostName );                 console_print( id, "[AMXX] You have set hostname to ^"%s^".", szHostName );     }         message_begin( MSG_BROADCAST, g_iMsgServerName );     write_string( szHostName );     message_end( );         return PLUGIN_HANDLED; }

quark 04-22-2012 18:46

Re: HELP - HOSTNAME
 
Quote:

Originally Posted by nikhilgupta345 (Post 1694790)
No you don't. It changes the hostname, but if you're in the server and press TAB, it is still going to show the old hostname. However, if people see your server in the master list, they will see the updated hostname displayed. If you want it to change for the people that are already in the server, I believe you can send a ServerName message or something like that to have it updated.

Thanks ! :D

quark 04-22-2012 18:48

Re: HELP - HOSTNAME
 
Quote:

Originally Posted by kramesa (Post 1694791)
Code:
#include < amxmodx > #include < amxmisc > new g_pHostName, g_iMsgServerName; public plugin_init( ) {  register_plugin( "amx_hostname", "1.0", "xPaw" );    register_clcmd( "amx_hostname", "CmdHostName", ADMIN_CFG, "<hostname>" );    g_iMsgServerName = get_user_msgid( "ServerName" );  g_pHostName      = get_cvar_pointer( "hostname" ); } public CmdHostName( const id, const iLevel, const iCid ) {  if( !cmd_access( id, iLevel, iCid, 1 ) )   return PLUGIN_HANDLED;    new szHostName[ 64 ];    if( read_argc( ) == 1 ) {   console_print( id, "[AMXX] Hostname has been updated." );     get_pcvar_string( g_pHostName, szHostName, 63 );  } else {   read_argv( 1, szHostName, 63 );     set_pcvar_string( g_pHostName, szHostName );     console_print( id, "[AMXX] You have set hostname to ^"%s^".", szHostName );  }    message_begin( MSG_BROADCAST, g_iMsgServerName );  write_string( szHostName );  message_end( );    return PLUGIN_HANDLED; }

Oh, thanks kramesa. I will check it later :D

EDIT Sorry for double :3

NeedYourHelp 04-23-2012 07:11

Re: HELP - HOSTNAME
 
amx_rcon hostname "Name"
or
admin_rcon hostname "Name"


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

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