Jump to content
  • 0

[help support] Not allow 2 client


dize11

Question


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  93
  • Reputation:   0
  • Joined:  01/30/12
  • Last Seen:  

Need to check if this script its ok. Because is not working on my server. In case it had some error

- script Dont_allow_2_clients -1,{
end;

OnPCLoginEvent:
 query_sql "SELECT last_ip FROM login WHERE account_id = "+getcharid(3)+"",@RIDIP;
 query_sql "INSERT INTO On_ip_table ("+@RIDIP+")";
 query_sql "UPDATE On_ip_table SET ips_online = ips_online + 1 WHERE last_ip = "+@RIDIP+"";
 query_sql "SELECT ips_online FROM on_ip_table WHERE last_ip = "+@RIDIP+"",@TIMESON;
 if(@TIMESON >= 2) {
  dispbotton "[staff]";
  dispbotton strcharinfo(0)+" you can't log with two windows opened";
  dispbotton "I need kick you now";
  sleep2 5000; // Just to the player read.
  atcommand "@kick "+strcharinfo(0);
 }
 end;
OnPCLogoutEvent:
 query_sql "SELECT last_ip FROM login WHERE account_id = "+getcharid(3)+"",@RIDIP;
 query_sql "UPDATE on_ip_table SET ips_online = 0 WHERE last_ip = "+@RIDIP+"";
 end;
OnInit:
 CREATE TABLE IF NOT EXISTS on_ip_table (last_ip varchar(100) NOT NULL default '',ips_online int(11) NOT NULL DEFAULT '0',PRIMARY KEY  (`last_ip`)) ENGINE=MyISAM AUTO_INCREMENT=2000000;// SET THE ENGINE MAKE THE TABLE BE ACESSED FASTER
}

please replay thanks you!

Link to comment
Share on other sites

1 answer to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

you may try this...

made by Brian

http://athena-script.../only3perIP.txt

the amount limit....

just edit the value "3" that you can find inside the script..

and use search before posting...coz it has been posted by other several times. ^^

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...