Raised This Month: $ Target: $400
 0% 

[REQ] Hostname Request


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 10-10-2016 , 15:40   [REQ] Hostname Request
Reply With Quote #1

I already know how to do this.
__________________

Last edited by Relaxing; 03-30-2018 at 18:42.
Relaxing is offline
Artifact
Veteran Member
Join Date: Jul 2010
Old 10-10-2016 , 16:50   Re: [REQ] Hostname Request
Reply With Quote #2

You can try this solution
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new g_Hostname[20]
new 
temp[20]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
set_task(1.0"Change_Hostname",_,_,_,"b")
    
get_cvar_string("hostname"g_Hostnamecharsmax(g_Hostname))
    
    
set_task(0.5"Back_Hostname",_,_,_,"d")
    
copy("temp"charsmax(temp), g_Hostname)
}


public 
Change_Hostname() {
    new 
playersnum get_playersnum()
    new 
maxplayers get_maxplayers()
    new 
new_Hostname[32]
    
formatex(new_Hostnamecharsmax(new_Hostname), "%s - %s/%s"tempplayersnummaxplayers)
    
server_cmd("hostname %s"new_Hostname)
}

public 
Back_Hostname() 
    
server_cmd("hostname %s"temp
__________________
Artifact 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 11:58.


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