Thanks, its working./* 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
We use essential cookies to make this site work, and optional cookies to enhance your experience.