PDA

View Full Version : Disconnection through weapon?


pig132
08-26-2006, 01:28 AM
I'm not sure on how/which command you would use to use a players chat to disconnect a player. Anyone help? I tried sendtorc /disconnect blah but it didnt work..

Admins
08-26-2006, 01:37 AM
I think it's possible to reset but not disconnect. We have added sendtext-functionality for disconnect and reset on Rudora though, it's not enabled for the npcserver yet though (should it be enabled or may be only when the rights of the npcserver contain disconnect right and reset right?)

Omini
08-26-2006, 02:43 AM
Only thing I can think of, that I think you're wanting is this:

function onPlayerchats()
{
if (player.chat == "/disconnect") {
serverwarp("Login");
}
}

pig132
08-26-2006, 05:56 PM
Nono, i want it to disconnect the players chat..like if i type /dc pig132, it disconnects pig132. I know how to do it, but i just cant get how to make it disconnect them..This is what i have so far..
//#CLIENTSIDE
function onPlayerchats()
{
if (player.chat.starts("/dc"))
{
tokens = player.chat.tokenize;
}
with (getplayer(tokens[1])) {
serverwarp("Login");
}
}

KuJi
08-26-2006, 06:36 PM
Nono, i want it to disconnect the players chat..like if i type /dc pig132, it disconnects pig132. I know how to do it, but i just cant get how to make it disconnect them..This is what i have so far..
//#CLIENTSIDE
function onPlayerchats()
{
if (player.chat.starts("/dc"))
{
tokens = player.chat.tokenize;
}
with (getplayer(tokens[1])) {
serverwarp("Login");
}
}

Why are you doing serverside on clientside?

Staff Weapon or whatever:

function onActionServerSide(action)
{
switch (action)
{
case "dc":
{
plyr = findPlayer(params[1]);
plyr.triggerclient("gui", "-System", "connect", "Login");
break;
}
}
}
//#CLIENTSIDE
function onPlayerChats()
{
if (player.chat.starts("/dc"))
{
triggerserver("gui", name, "dc", player.chat.substring(4, -4));
}
}

In your system:

function onActionClientSide(action)
{
switch (action)
{
case "connect":
{
serverwarp(params[1]);
break;
}
}
}

That should work.