Posts: 1,506
Threads: 69
Joined: Feb 2008
Is there a function, or a plugin, include that adds a function to get the servers ip?
could be used like this;
new serverip = GetServerIP;
or something?
Posts: 1,506
Threads: 69
Joined: Feb 2008
Does It matter?
I could protect my gamemode a little more, im thinking of scripting one from scratch.
I could make the server shutdown, or lock itself if it doesn't have the correct ip :P
Posts: 51
Threads: 8
Joined: Dec 2009
Reputation:
0
Dude, how about
/serverip -> SendClientMessage(playerid, COLOR_GREEN, "This server`s IP address is .......");
and look at the server ip and type it instead of .........
Posts: 1,506
Threads: 69
Joined: Feb 2008
Quote:
Originally Posted by mihaitza55
Dude, how about
/serverip -> SendClientMessage(playerid, COLOR_GREEN, "This server`s IP address is .......");
and look at the server ip and type it instead of .........
|
Sorry, that was not what I was going to use it for.. I'm not a n00b on this, you know.
Posts: 1,506
Threads: 69
Joined: Feb 2008
Quote:
Originally Posted by Shadow™
pawn Код:
#define SERVER_IP "ip"
format(string,sizeof(string),"%s",SERVER_IP);
|
Now that is not what I asked for... I'm still not a n00b.
I asked if there was an include or something that added a function to get
the servers IP adress, so I can use It to check If It matches with my define, if not the server will lock down.
A protection, kind of.
like;
pawn Код:
#define SERVER_IP "xxx.xxx.xxx.xxx"
public OnGameModeInit()
{
new serverip = GetServerIP;
if(serverip==SERVER_IP){
// proceed
}else{
// lockdown
}
}
I just made this code on the forums here as an example, so it doesn't look very beautiful xD
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
Then you will have to add 'bind xxx.xxx.xxx.xxx' in your server.cfg.
Then use GetServerVarAsString to retrieve it.
Posts: 1,506
Threads: 69
Joined: Feb 2008
Oh, well that wasn't easy to remove was it?... Please spank me in the forhead..