Raised This Month: $ Target: $400
 0% 

Server IP


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 04-25-2013 , 12:36   Re: Server IP
Reply With Quote #1

net_address..

EDIT:

PHP Code:
#include <amxmodx>

new p_Server;
new 
g_szServer[32];

public 
plugin_init()
{
    
register_plugin("Server IP in Hud Text",AMXX_VERSION_STR,"SmileY");
    
    
p_Server get_cvar_pointer("net_address");
}

public 
plugin_cfg()
{
    
get_pcvar_string(p_Server,g_szServer,charsmax(g_szServer));
    
    
ServerIP();
}

public 
ServerIP()
{
    
set_hudmessage(random_num(50,255),random_num(50,255),random_num(50,255),0.02,0.9,1,6.0,30.0, .channel=4);
    
show_hudmessage(0,"Server Address: %s",g_szServer);
    
    
set_task(20.0,"ServerIP",1337);

__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 04-25-2013 at 12:45. Reason: :P
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 04-25-2013 , 23:19   Re: Server IP
Reply With Quote #2

Quote:
Originally Posted by ^SmileY View Post
PHP Code:
#include <amxmodx>

new p_Server;
new 
g_szServer[32];

public 
plugin_init()
{
    
register_plugin("Server IP in Hud Text",AMXX_VERSION_STR,"SmileY");
    
    
p_Server get_cvar_pointer("net_address");
}

public 
plugin_cfg()
{
    
get_pcvar_string(p_Server,g_szServer,charsmax(g_szServer));
    
    
ServerIP();
}

public 
ServerIP()
{
    
set_hudmessage(random_num(50,255),random_num(50,255),random_num(50,255),0.02,0.9,1,6.0,30.0, .channel=4);
    
show_hudmessage(0,"Server Address: %s",g_szServer);
    
    
set_task(20.0,"ServerIP",1337);

i'll use this method from now on.... as you say its a better solution.
__________________
Blizzard_87 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:54.


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