Yoona Posted April 26, 2013 Group: Members Topic Count: 153 Topics Per Day: 0.03 Content Count: 567 Reputation: 18 Joined: 04/15/13 Last Seen: April 21, 2016 Share Posted April 26, 2013 A IP based Freebies.. that they can use 1 IP at the same time Quote Link to comment Share on other sites More sharing options...
Patskie Posted July 11, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 16 hours ago Share Posted July 11, 2013 set .NPC$, "[ " strnpcinfo(1)+ " ]"; Should be : set .NPC$, "[ " +strnpcinfo(1)+ " ]"; Quote Link to comment Share on other sites More sharing options...
Patskie Posted April 26, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 16 hours ago Share Posted April 26, 2013 Execute this on your database CREATE TABLE IF NOT EXISTS `freebies` ( `id` int(11) NOT NULL auto_increment, `account_id` int(11) NOT NULL default '0', `name` varchar(23) NOT NULL default '', `last_ip` varchar(100) NOT NULL default '', PRIMARY KEY (`account_id`), KEY (`id`) ) ENGINE=MyISAM; Then try this code : prontera,150,150,0 script Freebies 100,{ mes .NPC$; mes "Wanna get the freebies " +strcharinfo(0)+ "?"; if (select("Yes:No") - 1) close; mes .NPC$; mes "Let me check if you are really a new member"; next; query_sql("SELECT last_ip FROM `login` WHERE account_id = "+getcharid(3)+"", .@lastip$); query_sql("SELECT last_ip FROM `freebies`", .@freebiesip$); if (.@lastip$ == .@freebiesip$) { mes .NPC$; mes "You already got the freebies " +strcharinfo(0); close; } query_sql("INSERT INTO `freebies` VALUES (NULL," + getcharid(3) + ",'" + escape_sql(strcharinfo(0)) + "','" + .@lastip$ + "')"); for ( set .@x,0; .@x < getarraysize(.freebie_item); set .@x,.@x + 1 ) { getitem .freebie_item[.@x], ..quantity[.@x]; } close; OnInit: set .NPC$, "[ " strnpcinfo(1)+ " ]"; setarray .freebie_item[0],607,608; setarray .quantity[0],1,1; } Did not test though. Post if an error occured. Quote Link to comment Share on other sites More sharing options...
0 creed.sin Posted April 16, 2020 Group: Members Topic Count: 10 Topics Per Day: 0.00 Content Count: 34 Reputation: 1 Joined: 12/13/11 Last Seen: August 1, 2024 Share Posted April 16, 2020 On 4/26/2013 at 10:16 AM, Patskie said: Execute this on your database CREATE TABLE IF NOT EXISTS `freebies` ( `id` int(11) NOT NULL auto_increment, `account_id` int(11) NOT NULL default '0', `name` varchar(23) NOT NULL default '', `last_ip` varchar(100) NOT NULL default '', PRIMARY KEY (`account_id`), KEY (`id`) ) ENGINE=MyISAM; Then try this code : prontera,150,150,0 script Freebies 100,{ mes .NPC$; mes "Wanna get the freebies " +strcharinfo(0)+ "?"; if (select("Yes:No") - 1) close; mes .NPC$; mes "Let me check if you are really a new member"; next; query_sql("SELECT last_ip FROM `login` WHERE account_id = "+getcharid(3)+"", .@lastip$); query_sql("SELECT last_ip FROM `freebies`", .@freebiesip$); if (.@lastip$ == .@freebiesip$) { mes .NPC$; mes "You already got the freebies " +strcharinfo(0); close; } query_sql("INSERT INTO `freebies` VALUES (NULL," + getcharid(3) + ",'" + escape_sql(strcharinfo(0)) + "','" + .@lastip$ + "')"); for ( set .@x,0; .@x < getarraysize(.freebie_item); set .@x,.@x + 1 ) { getitem .freebie_item[.@x], ..quantity[.@x]; } close; OnInit: set .NPC$, "[ " strnpcinfo(1)+ " ]"; setarray .freebie_item[0],607,608; setarray .quantity[0],1,1; } Did not test though. Post if an error occured. error occurred, if same user logged from another IP Please help Quote Link to comment Share on other sites More sharing options...
Yoona Posted July 10, 2013 Group: Members Topic Count: 153 Topics Per Day: 0.03 Content Count: 567 Reputation: 18 Joined: 04/15/13 Last Seen: April 21, 2016 Author Share Posted July 10, 2013 Execute this on your database CREATE TABLE IF NOT EXISTS `freebies` ( `id` int(11) NOT NULL auto_increment, `account_id` int(11) NOT NULL default '0', `name` varchar(23) NOT NULL default '', `last_ip` varchar(100) NOT NULL default '', PRIMARY KEY (`account_id`), KEY (`id`) ) ENGINE=MyISAM; Then try this code : prontera,150,150,0 script Freebies 100,{ mes .NPC$; mes "Wanna get the freebies " +strcharinfo(0)+ "?"; if (select("Yes:No") - 1) close; mes .NPC$; mes "Let me check if you are really a new member"; next; query_sql("SELECT last_ip FROM `login` WHERE account_id = "+getcharid(3)+"", .@lastip$); query_sql("SELECT last_ip FROM `freebies`", .@freebiesip$); if (.@lastip$ == .@freebiesip$) { mes .NPC$; mes "You already got the freebies " +strcharinfo(0); close; } query_sql("INSERT INTO `freebies` VALUES (NULL," + getcharid(3) + ",'" + escape_sql(strcharinfo(0)) + "','" + .@lastip$ + "')"); for ( set .@x,0; .@x < getarraysize(.freebie_item); set .@x,.@x + 1 ) { getitem .freebie_item[.@x], ..quantity[.@x]; } close; OnInit: set .NPC$, "[ " strnpcinfo(1)+ " ]"; setarray .freebie_item[0],607,608; setarray .quantity[0],1,1; } Did not test though. Post if an error occured. there's an Error at line 17, what should i do ???? Quote Link to comment Share on other sites More sharing options...
Patskie Posted July 10, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 16 hours ago Share Posted July 10, 2013 getitem .freebie_item[.@x], ..quantity[.@x]; Should be : getitem .freebie_item[.@x], .quantity[.@x]; Quote Link to comment Share on other sites More sharing options...
Yoona Posted July 11, 2013 Group: Members Topic Count: 153 Topics Per Day: 0.03 Content Count: 567 Reputation: 18 Joined: 04/15/13 Last Seen: April 21, 2016 Author Share Posted July 11, 2013 (edited) getitem .freebie_item[.@x], ..quantity[.@x]; Should be : getitem .freebie_item[.@x], .quantity[.@x]; now there's a problem in line 23, i check the problem it says parse_line need ";" but i check the script its not missing ";" line 23 set .NPC$, "[ " strnpcinfo(1)+ " ]"; what should i do? Edited July 11, 2013 by Yoona Quote Link to comment Share on other sites More sharing options...
Yoona Posted July 11, 2013 Group: Members Topic Count: 153 Topics Per Day: 0.03 Content Count: 567 Reputation: 18 Joined: 04/15/13 Last Seen: April 21, 2016 Author Share Posted July 11, 2013 set .NPC$, "[ " strnpcinfo(1)+ " ]"; Should be : set .NPC$, "[ " +strnpcinfo(1)+ " ]"; Wow! thanks Patskie =) Quote Link to comment Share on other sites More sharing options...
jiajofer Posted June 4, 2014 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 2 Reputation: 0 Joined: 05/15/14 Last Seen: July 10, 2014 Share Posted June 4, 2014 did not work for my server. Quote Link to comment Share on other sites More sharing options...
Question
Yoona
A IP based Freebies..
that they can use 1 IP at the same time
Link to comment
Share on other sites
8 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.