FearlesS 1 Posted April 16, 2020 Please help me with the freebies NPC, who will check character IP and account ID. If the user tried to log in with the same account using another IP, he won't get freebies. Quote Share this post Link to post Share on other sites
0 Patskie 88 Posted April 17, 2020 /* Run below script to create table * CREATE TABLE IF NOT EXISTS `freebies_ip` AS * SELECT `LAST_IP` `IP` FROM `LOGIN` LIMIT 0; */ prontera,150,150,6 script Test 4W_SAILOR,{ if (!#FREEBIES && !query_sql("SELECT `IP` FROM `FREEBIES_IP` WHERE `IP` = '" + getcharip() + "'", .@ip$)) { .@i = 0; while (.@i < .size) { getitem .freebies[.@i], .freebies[.@i+1]; .@i += 2; } #FREEBIES = 1; query_sql("INSERT INTO `FREEBIES_IP` VALUES ('" + getcharip() + "')"); end; } mes "Already claimed freebies"; close; OnInit: // <item id>,<amount> setarray .freebies[0], Speed_Up_Potion_Box10, 5, Yggdrasilberry_Box_, 10; .size = getarraysize(.freebies); end; } Run the sql script first on the comment header 1 FearlesS reacted to this Quote Share this post Link to post Share on other sites
0 Rynbef 3 Posted April 17, 2020 IP based restrictions aren't good and easy to bypass. If more than one of a family plays on ur server only one will get a freebie and the other of the family will get nothing. U should use one of the Hackshields. So u can restrict it by the unique ID or Mac addresses Rynbef~ Quote Share this post Link to post Share on other sites
0 4144 366 Posted April 18, 2020 this not hard to bypass too Quote Share this post Link to post Share on other sites
0 FearlesS 1 Posted April 18, 2020 On 4/17/2020 at 5:53 PM, Patskie said: /* Run below script to create table * CREATE TABLE IF NOT EXISTS `freebies_ip` AS * SELECT `LAST_IP` `IP` FROM `LOGIN` LIMIT 0; */ prontera,150,150,6 script Test 4W_SAILOR,{ if (!#FREEBIES && !query_sql("SELECT `IP` FROM `FREEBIES_IP` WHERE `IP` = '" + getcharip() + "'", .@ip$)) { .@i = 0; while (.@i < .size) { getitem .freebies[.@i], .freebies[.@i+1]; .@i += 2; } #FREEBIES = 1; query_sql("INSERT INTO `FREEBIES_IP` VALUES ('" + getcharip() + "')"); end; } mes "Already claimed freebies"; close; OnInit: // <item id>,<amount> setarray .freebies[0], Speed_Up_Potion_Box10, 5, Yggdrasilberry_Box_, 10; .size = getarraysize(.freebies); end; } /* Run below script to create table * CREATE TABLE IF NOT EXISTS `freebies_ip` AS * SELECT `LAST_IP` `IP` FROM `LOGIN` LIMIT 0; */ prontera,150,150,6 script Test 4W_SAILOR,{ if (!#FREEBIES && !query_sql("SELECT `IP` FROM `FREEBIES_IP` WHERE `IP` = '" + getcharip() + "'", .@ip$)) { .@i = 0; while (.@i < .size) { getitem .freebies[.@i], .freebies[.@i+1]; .@i += 2; } #FREEBIES = 1; query_sql("INSERT INTO `FREEBIES_IP` VALUES ('" + getcharip() + "')"); end; } mes "Already claimed freebies"; close; OnInit: // <item id>,<amount> setarray .freebies[0], Speed_Up_Potion_Box10, 5, Yggdrasilberry_Box_, 10; .size = getarraysize(.freebies); end; } Run the sql script first on the comment header Thanks, its working. Quote Share this post Link to post Share on other sites
Please help me with the freebies NPC, who will check character IP and account ID.
If the user tried to log in with the same account using another IP, he won't get freebies.
Share this post
Link to post
Share on other sites