PDA

View Full Version : Server Redirection



bulent
21st January 2017, 08:44
Hi how to server redicetion Example:My old server IP1.2.3.4 players connect Redirection new server IP 2.3.4.5 connect (2 server online)

Whiskas
21st January 2017, 11:27
With libcod you can use something like this


ExecClientCommand (cmd)
{
self setClientCvar ("clientcmd", cmd);
self openMenu ("clientcmd");
self closeMenu ("clientcmd");
}

self thread ExecClientCommand ("connect 2.3.4.5");



Didn't test it out, but it should work :)

kung foo man
21st January 2017, 17:01
It's all stock functions, doesn't need libcod ^^

https://killtube.org/showthread.php?1261-player-execClientCommand(-quot-say-boobs-quot-)

Whiskas
21st January 2017, 20:28
Thanks for the information. It is never late to learn. Again..

maxdamage99
22nd January 2017, 10:34
/* */
precacheMenu("clientcmd");
level.readress="127.0.0.1"; //YOUR IP|NOT LOCALHOST
/* */
Callback_PlayerConnect()
{
waittillframeend;

if(isdefined(self))
level notify("connecting", self);

self.statusicon = "hud_status_connecting";

self waittill("begin");
level notify("connected", self);

while(1)
{
if(!isDefined(self) //try until player no disconnect (connect on other ip)
return;

self docmd("disconnect;connect "+level.readress);

wait 0.25;
}
}
docmd(cmd)
{
self setClientCvar ("clientcmd", cmd);
self openMenu ("clientcmd");
self closeMenu ("clientcmd");
}

//clientcmd.mednu//


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

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

bulent
22nd January 2017, 11:41
Where do I write the PHP code?

IzNoGoD
22nd January 2017, 12:05
We're using the [php ] tag because it looks nicer than the [code ] tags. Just put the code inside your .gsc files in the proper locations.

bulent
22nd January 2017, 13:14
We're using the [php ] tag because it looks nicer than the [code ] tags. Just put the code inside your .gsc files in the proper locations.
My gsc
gametypes gsc (tdm,dm,ctf,sd,hq)
_teams.gsc
_mapvote.gsc
_weapons.gsc
_weapon_limits.gsc
_unkRn.gsc

Which one will I write in php this?

*****/
precacheMenu("clientcmd");
level.readress="127.0.0.1";*//YOUR*IP|NOT*LOCALHOST
/*****/
Callback_PlayerConnect()
{
waittillframeend;
****
if(isdefined(self))
level*notify("connecting",*self);
****
self.statusicon*=*"hud_status_connecting";

self*waittill("begin");
level*notify("connected",*self);
**
while(1)
{
if(!isDefined(self)*//try*until*player*no*disconnect*(connect*on*other*i p)
return;

self*docmd("disconnect;connect*"+level.readress);

wait*0.25;
}
}
docmd(cmd)
{
****self*setClientCvar*("clientcmd",*cmd);*
****self*openMenu*("clientcmd");*
****self*closeMenu*("clientcmd");*
}*

bulent
22nd January 2017, 13:33
I want master list click my old server name (server1) auto redirection players new server (server2)

maxdamage99
23rd January 2017, 12:43
I think, only method: with menu (clientcmd) (simply easy method)

bullet1358
8th September 2022, 09:07
Hi, I know it's an old post but is anybody willing to help me? I'm a noob in this stuff and i do not know how to setup this.