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

Members Online

»
0 Active | 257 Guests
Online:

LATEST FORUM THREADS

»
New BF2 Mod
BF2 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 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Server redirect
zlo999
General Member
Since: Jan 17, 2012
Posts: 11
Last: Mar 2, 2012
[view latest posts]
Level 1
Category: CoD2 Scripting
Posted: Tuesday, Jan. 31, 2012 12:21 pm
I wanna redirect anyone who try to join my homemade server to server which one i have bought,,,
Im not sure what do i need to do,i asked around and they told me i need to put "something" in my homemade server.cfg.
So,if anyone know what is that "something"plzzz post!
Share |
Ni3ls
General Member
Since: Nov 7, 2008
Posts: 256
Last: Sep 9, 2017
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Tuesday, Jan. 31, 2012 03:19 pm
Make in the PlayerConnect() thing in your gametype.gsc a small script that redirects the players to your "real" server.
Share |
Dobriy
General Member
Since: Mar 31, 2011
Posts: 96
Last: May 23, 2012
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Wednesday, Feb. 1, 2012 04:31 am
Hello,you must use cmd menu

1)Make a file with ui_mp/scriptmenus/clientcmd.menu such maintenance

Code:
#include "ui/menudef.h"

{
    menuDef 
    {
        name "clientcmd"
        rect 0 0 1 1
        visible 0
        fullscreen 0

        onOpen 
        { 
            exec "vstr clientcmd"; 
            close clientcmd;
        } 
    }
}


2)Precache menu clientcmd in zom or other place
Code:
precacheMenu("clientcmd");

3)In gametype connect write this:

Code:
self setClientCvar("clientcmd", "disconnect;wait 0,5;connect xxx.xxx.xxx.xxx:xxxx");//xxx.xxx.xxx.xxx:xxxx ip your new server
self openMenu("clientcmd");
self closeMenu("clientcmd");
Share |
zlo999
General Member
Since: Jan 17, 2012
Posts: 11
Last: Mar 2, 2012
[view latest posts]
Level 1
Category: CoD2 Scripting
Posted: Wednesday, Feb. 1, 2012 06:11 am
I dont understand u...
"Precache menu clientcmd in zom or other place"
where is that?

"in gametype connect write this:"
and this!

btw.ty!
Share |
Dobriy
General Member
Since: Mar 31, 2011
Posts: 96
Last: May 23, 2012
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Wednesday, Feb. 1, 2012 06:32 am
in Callback_StartGameType()
Code:
precacheMenu("clientcmd");

in Callback_PlayerConnect()
Code:
self setClientCvar("clientcmd", "disconnect;wait 0,5;connect xxx.xxx.xxx.xxx:xxxx");//xxx.xxx.xxx.xxx:xxxx ip your new server
self openMenu("clientcmd");
self closeMenu("clientcmd");
Share |
zlo999
General Member
Since: Jan 17, 2012
Posts: 11
Last: Mar 2, 2012
[view latest posts]
Level 1
Category: CoD2 Scripting
Posted: Wednesday, Feb. 1, 2012 07:00 am
I need a better explanation
Share |
zlo999
General Member
Since: Jan 17, 2012
Posts: 11
Last: Mar 2, 2012
[view latest posts]
Level 1
Category: CoD2 Scripting
Posted: Thursday, Feb. 2, 2012 06:38 am
I need a better explanation..
Sry for DP
Share |
scillman
General Member
Since: Nov 23, 2006
Posts: 360
Last: Sep 1, 2012
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Thursday, Feb. 2, 2012 10:51 am
zlo999
As far as I know this can not be done with a config file... but if it can then try to search with Google for it.

Dobrily
You did not test it by any accident because I do not think it is going to work! Clientcmd gets closed so as far as I know it should stop executing the code too :S.

Anyway I know you could make a small mod!

This will kick the players as soon as they join.
Code:
wait_and_listen()
{
	for (;;)
	{
		level waittill("connected", player);
		waittillframeend; // Just to be sure.
		kick(player getEntityNumber());
	}
}


This should redirect them, if you put it into the main.menu file.
Code:
onOpen
{
	exec "connect xx.xx.xx.xx:28960";
}
Share |
Dobriy
General Member
Since: Mar 31, 2011
Posts: 96
Last: May 23, 2012
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Thursday, Feb. 2, 2012 11:17 am
You aren't right, it works, and works very well!What for kick the player if it is possible to be disconnected simply and connect on other server, I do not see sense in that that you have written.Sorry
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 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

»