prontera,168,184,3 script Freebies 479,{ 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]; }
Question
Yoona
Its all about this script:
prontera,168,184,3 script Freebies 479,{
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],30316,30315,30314,30027,30028,30029,30030,4302,4403,7227,30499,671,2629,2630,4140;
setarray .quantity[0],1,1,1,1,1,1,1,1,1,1000,1,1000,2,2,4;
waitingroom "Freebies Here",0;
}
and on mysql
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;
it keeps giving items, and here's a picture of SQL error's
Bump =( Please
Edited by Yoona1 answer 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.