tmav94 1 Posted February 3, 2015 (edited) I want to prevent that the same player to open a multiples instance of an NPC in different account, tracking by ip [eg]... I try many things to do this work, but whitout sucess. Let explain... When a player touch on specific npc, this send the IP to a MySql Table. if he try to access the same npc in another account, the npc will say that he dont have permission while the another account instance is open. How this npc will do that?He (npc) will get with query_sql the IP and Name of character that initialize the dialog with npc.Anyone know some easyway to do that? I unfortunately do not know. Edited February 3, 2015 by tmav94 Quote Share this post Link to post Share on other sites
0 evilpuncker 503 Posted February 3, 2015 if (query_sql("SELECT login.account_id FROM login LEFT JOIN `char` ON login.account_id=`char`.account_id WHERE login.last_ip=(SELECT last_ip FROM login WHERE account_id="+getcharid(3)+") AND `char`.online=1", .@account_id) > 1) { end script } else { run script } 1 tmav94 reacted to this Quote Share this post Link to post Share on other sites
0 tmav94 1 Posted February 3, 2015 Hey, wait... I dont...Ok, listen...can you explain me the things that ill list in bold? I never see this structure of query's... if (query_sql("SELECT login.account_id FROM login LEFT JOIN `char` ON login.account_id=`char`.account_id WHERE login.last_ip=(SELECT last_ip FROM login WHERE account_id="+getcharid(3)+") AND `char`.online=1", .@account_id) > 1) { end script } else { run script } Quote Share this post Link to post Share on other sites
0 evilpuncker 503 Posted February 3, 2015 it is selecting 'login' that got an 'online'(0 = offline) character from the same 'last_ip', since they are two different tables, it uses left join 1 tmav94 reacted to this Quote Share this post Link to post Share on other sites
0 tmav94 1 Posted February 3, 2015 In this case the script will prevent the player to access the npc while another accounts are connected... Now, the script will unlock access when all other accounts on same ip are disconnected, is it? Quote Share this post Link to post Share on other sites
0 tmav94 1 Posted February 3, 2015 (edited) it is selecting 'login' that got an 'online'(0 = offline) character from the same 'last_ip', since they are two different tables, it uses left join Sorry for double posting, i think that my post will be merged with another one. Edited February 3, 2015 by tmav94 Quote Share this post Link to post Share on other sites
I want to prevent that the same player to open a multiples instance of an NPC in different account, tracking by ip [eg]...
I try many things to do this work, but whitout sucess.
He (npc) will get with query_sql the IP and Name of character that initialize the dialog with npc.
Anyone know some easyway to do that? I unfortunately do not know.
Share this post
Link to post
Share on other sites