Author Topic: Simple reconnected player detect  (Read 2176 times)

sasha19323

  • Jr. Member
  • **
  • Posts: 99
  • Karma: +25/-24
    • View Profile
Simple reconnected player detect
« on: June 27, 2014, 08:04:10 pm »
Just add this code on onScriptLoad client-side event:
Code: ("Client-side script") [Select]
try
{
      HashTable("lalka"); //Here can be any name of table;
}
catch(e)
{
      //if player has been reconnected
      Message("You have been kicked. Please type /q and join again", Colour(255, 0, 0));
      CallServerFunc(null, "KickPlayer", FindLocalPlayer());
}
This snippet will help you prevent some /reconnect bugs(objects removing etc).

Thijn

  • Tester
  • Sr. Member
  • ****
  • Posts: 531
  • Karma: +27/-16
    • View Profile
Re: Simple reconnected player detect
« Reply #1 on: June 28, 2014, 04:31:37 pm »
I'm not sure why this would work, care to explain?

sasha19323

  • Jr. Member
  • **
  • Posts: 99
  • Karma: +25/-24
    • View Profile
Re: Simple reconnected player detect
« Reply #2 on: June 28, 2014, 06:17:36 pm »
I'm not sure why this would work, care to explain?
I've found, that hashes won't be cleaned after /reconnect. If hash already exists there will be an error.

Thijn

  • Tester
  • Sr. Member
  • ****
  • Posts: 531
  • Karma: +27/-16
    • View Profile
Re: Simple reconnected player detect
« Reply #3 on: June 29, 2014, 04:54:46 pm »
I'm not sure why this would work, care to explain?
I've found, that hashes won't be cleaned after /reconnect. If hash already exists there will be an error.
Ah like that, nice find.

 

© Liberty Unleashed Team.