Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Reconnect System Help please!:) (https://forums.graalonline.com/forums/showthread.php?t=134266770)

Fanty 07-05-2012 06:50 PM

Reconnect System Help please!:)
 
I have a problem with a reconnect system i want if the player says /reconnect he reconnects but in my script something failed,i'll show you.

PHP Code:

if (tokens[0] == "/reconnect") {
    
this.canuse = {"Graal773341"};
    if (
player.account in this.canusetriggerserver("gui"name"recall");
  }


help plz thanks.

Fanty 07-05-2012 06:50 PM

it reconnects all players instead of one... :(

DrakilorP2P 07-05-2012 07:01 PM

What does it look like on the serverside part of the code?

cbk1994 07-05-2012 07:07 PM

To reconnect a player, you need to call serverWarp(servername); clientside. If the player is the one doing the reconnecting, there's no reason to go serverside at all; just handle it in a clientside script instead in ChatBar.onAction or onPlayerChats.

Fanty 07-05-2012 08:26 PM

Quote:

Originally Posted by cbk1994 (Post 1699016)
To reconnect a player, you need to call serverWarp(servername); clientside. If the player is the one doing the reconnecting, there's no reason to go serverside at all; just handle it in a clientside script instead in ChatBar.onAction or onPlayerChats.

So it needs to be:
PHP Code:

//Clientside
if onPlayerChat=/reconnect
serverWarp
(servername); 

I'm new in scripting so >_<

Emera 07-05-2012 09:41 PM

PHP Code:

//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat == "/reconnect") {
    
serverwarp(servername);
  }


That'll work.

cbk1994 07-05-2012 11:24 PM

Quote:

Originally Posted by Fanty (Post 1699026)
So it needs to be:
PHP Code:

//Clientside
if onPlayerChat=/reconnect
serverWarp
(servername); 

I'm new in scripting so >_<

If you're interested in learning, this is a good place to start.

skillmaster19 07-06-2012 08:27 AM

I would personally recommend using twinny's guide to learn the very basics, then fp4's to learn more advanced stuff.

Imperialistic 07-06-2012 08:53 AM

Here is the link to Twinny's guide if you need it; click me

Fanty 07-06-2012 01:28 PM

Thanks everyone,your so nice guys <3 thxxxx emera too

devilsknite1 07-19-2012 06:45 PM

Quote:

Originally Posted by Fanty (Post 1699026)
PHP Code:

//Clientside
if onPlayerChat=/reconnect
serverWarp
(servername); 


tf

Once www.graal.net comes online again, I'd suggest checking the development section out, along with both Twinny's and FP4's guide to scripting. :)


All times are GMT +2. The time now is 03:40 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.