View Single Post
Jackol1234
Senior Member
Join Date: Apr 2015
Old 06-01-2016 , 12:55   Re: Level rank plugin Help
Reply With Quote #20

I don't know if it's possible to grab the port. The one thing I found using google was:

PHP Code:
int iPort GetConVarInt(FindConVar("hostport")); 
but this requires you to use hostport in the command-line while starting up your server. To test this out and see if it works for you, change your OnPluginStart code to this:

PHP Code:
public void OnPluginStart()
{
    
SQL_TConnect(SQLCallback_Connect"ckSurf");

    
int iPort GetConVarInt(FindConVar("hostport"));
    
LogMessage("This servers port is %i"iPort);

Then look in your console or your log files and see what it says. If it shows "This servers port is " then it will not work, otherwise I'll code something up for you.
__________________
Accepting PM's for private requests!

Last edited by Jackol1234; 06-01-2016 at 12:56.
Jackol1234 is offline