Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 9 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 4
Category: CoD4 Scripting
Scripting and coding with Call of Duty 4.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Check server IP on map load
18Rabbit
General Member
Since: Apr 12, 2009
Posts: 196
Last: Jul 11, 2010
[view latest posts]
Level 4
Category: CoD4 Scripting
Posted: Friday, Apr. 16, 2010 04:12 am
Is it possible to check the server IP on map load and if it's not the right IP shut down the map?

I have a map that I test on my clan's server and we sometimes have non-clan members test it with us. Well, one of them loaded my unfinished map onto their clan's server. Which, I'm pretty ticked about. So, I would like to prevent that, until it's ready for distribution. Any ideas? Thanks.
Share |
_INSANE_
General Member
Since: Nov 7, 2008
Posts: 352
Last: Jul 10, 2011
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Friday, Apr. 16, 2010 04:28 am
Sure thing.
Code:
serverIP = getDvar("net_ip") + ":" + getDvar("net_port");


Unless you dont need the port...
getDvar("net_ip") would just show up like "8.6.75.18" .... but the code i gave would show up as "8.6.75.18:28960"
Share |
18Rabbit
General Member
Since: Apr 12, 2009
Posts: 196
Last: Jul 11, 2010
[view latest posts]
Level 4
Category: CoD4 Scripting
Posted: Friday, Apr. 16, 2010 06:06 am
_INSANE_ writes...
Quote:
Sure thing.
Code:
serverIP = getDvar("net_ip") + ":" + getDvar("net_port");


Unless you dont need the port...
getDvar("net_ip") would just show up like "8.6.75.18" .... but the code i gave would show up as "8.6.75.18:28960"


Sweet, and I put the server IP in "net_ip" and the port in "net_port"? And where does the script go? mymap.gsc?

Thanks alot. :)
Share |
_INSANE_
General Member
Since: Nov 7, 2008
Posts: 352
Last: Jul 10, 2011
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Friday, Apr. 16, 2010 06:18 am
well you'd have to make a small script that starts up when your map does.. then make it skip to the next map if the ip isn't right... i'm pretty sure there is a command for ending the map too.

EDIT:
Try something like this:
Code:
checkIP()
{
	serverIP = getDvar("net_ip") + ":" + getDvar("net_port");
	if(serverIP != "8.6.75.18:28960")
		map("mp_shipment");
}


Except throw in your own IP..
Share |
18Rabbit
General Member
Since: Apr 12, 2009
Posts: 196
Last: Jul 11, 2010
[view latest posts]
Level 4
Category: CoD4 Scripting
Posted: Saturday, Apr. 17, 2010 08:59 pm
Thanks. :)
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»