Raised This Month: $ Target: $400
 0% 

How to print server ip ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
EmreBulut
Junior Member
Join Date: Sep 2015
Location: Turkey, Istanbul
Old 10-08-2015 , 11:55   How to print server ip ?
Reply With Quote #1

I want show ip in chat when i type sm_ip how can i do that ?
EmreBulut is offline
Maxximou5
AlliedModders Donor
Join Date: Feb 2013
Old 10-08-2015 , 12:22   Re: How to print server ip ?
Reply With Quote #2

Search for it already have been made here: http://www.sourcemod.net/plugins.php or https://forums.alliedmods.net/search.php
Request to have it coded here: https://forums.alliedmods.net/forumdisplay.php?f=60
Learn to code it here: https://forums.alliedmods.net/forumdisplay.php?f=107 or https://wiki.alliedmods.net/Introduction_to_sourcepawn
Maxximou5 is offline
EmreBulut
Junior Member
Join Date: Sep 2015
Location: Turkey, Istanbul
Old 10-08-2015 , 12:43   Re: How to print server ip ?
Reply With Quote #3

Not working for csgo
EmreBulut is offline
Maxximou5
AlliedModders Donor
Join Date: Feb 2013
Old 10-08-2015 , 13:24   Re: How to print server ip ?
Reply With Quote #4

Not even remotely possible, none of those links were CS:GO plugins.
You have to find, request, or code the plugin yourself, if you did, reply to that thread on why it doesn't work.

Someone else can help you now, because you seem unwilling.
Maxximou5 is offline
Darkness_
Veteran Member
Join Date: Nov 2014
Old 10-08-2015 , 13:27   Re: How to print server ip ?
Reply With Quote #5

Someone else on these forums posted this snippet, I did not write any of this - I simply saved it for my own reference. And yes, it works for CS:GO.

PHP Code:
    int pieces[4];
    
int longip GetConVarInt(FindConVar("hostip"));
    
    
pieces[0] = (longip >> 24) & 0x000000FF;
    
pieces[1] = (longip >> 16) & 0x000000FF;
    
pieces[2] = (longip >> 8) & 0x000000FF;
    
pieces[3] = longip 0x000000FF;

    
char NetIP[32];
    
Format(NetIPsizeof(NetIP), "%d.%d.%d.%d"pieces[0], pieces[1], pieces[2], pieces[3]); 
Edit: I believe I found it here: https://forums.alliedmods.net/showpo...2&postcount=14

Last edited by Darkness_; 10-08-2015 at 13:29.
Darkness_ is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 10-08-2015 , 18:43   Re: How to print server ip ?
Reply With Quote #6

I'm sure there is an easier way of doing this.

Not home atm to pull my console code that auto registers new servers.

I'm sure I have a one liner for ip and port.
__________________
Neuro Toxin 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 23:03.


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