Raised This Month: $51 Target: $400
 12% 

[REQ] Get Player Port


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Uncommon
Junior Member
Join Date: Sep 2015
Old 09-13-2015 , 15:48   [REQ] Get Player Port
Reply With Quote #1

Hi,

Is there a way to get player connection port? I know there's a way to get user IP with this simple line:

Code:
new ip[46], name[33];
	
get_user_ip(id, ip, 45, 0);
The last 5 digits of the variable would be the ports in this case. How do I get those 5 digits and store them in a variable? Or is there another simplier way?

Last edited by Uncommon; 09-13-2015 at 15:50.
Uncommon is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-13-2015 , 18:33   Re: [REQ] Get Player Port
Reply With Quote #2

There is no other way to get it because there does not need to be. Simply search for the ":" and take the numbers after it.

Why do you need to know the port? How is it at all relevant?
__________________

Last edited by fysiks; 09-13-2015 at 18:33.
fysiks is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-13-2015 , 20:12   Re: [REQ] Get Player Port
Reply With Quote #3

im wondering what are you trying to do o.O
Depresie is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 09-13-2015 , 21:00   Re: [REQ] Get Player Port
Reply With Quote #4

PHP Code:
new szIP24 ];
get_user_ipid szIP charsmaxszIP ) , );

//port
szIPstrfindszIP ":" ) + 
__________________
Bugsy 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 04:32.


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