Jump to content
  • 0

Help me Please =(


Yoona

Question


  • Group:  Members
  • Topic Count:  153
  • Topics Per Day:  0.04
  • Content Count:  567
  • Reputation:   18
  • Joined:  04/15/13
  • Last Seen:  

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

 

 

post-16619-0-84622300-1373671324_thumb.jpg



Bump =( Please

Edited by Yoona
Link to comment
Share on other sites

1 answer to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  79
  • Topics Per Day:  0.02
  • Content Count:  327
  • Reputation:   4
  • Joined:  06/22/13
  • Last Seen:  

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

 

 

attachicon.giferror.jpg

Bump =( Please

try this one, easy to edit, properly working and it will give freebies only once per account:

//============================================
//= Npc that gives freebies to the new
//============================================
//= Rewritten by SkittleNugget (rAthena.org)
//============================================
prontera,146,161,6	script	Novice Support	893,{

    if( #PlayerRecievedFreebies )
	{
		mes "[Lisa]";
		emotion	e_swt2;
		mes "You already claimed your free items or you are not a novice anymore, Remember that i'll give you some free stuffs only once per account!";
		close;
	}
		else if ( Class < 1 )
	{
		mes "[Lisa]";
		emotion	e_ho;
		mes "Hello young adventurer and welcome to Kyojin RO";
		mes "I can give you some free items to help you grown fast";
		mes "Do you want it?";
		next;
		if ( select("You're so kind. Thank you!:Nah~ Im too pro for this!")==2)
		{
			mes "[Lisa]";
			emotion	e_ag;
			mes "Such a arrogant person.";
			mes "^ff0000@kill "+ strcharinfo(0) +"^000000";
			next;
			mes "[Lisa]";
			emotion	e_omg;
			mes "Why my command not work?!";
			mes "Maybe you're lucky!";
			close;
		}
		mes "[Lisa]";
		emotion	e_kis;
		mes "Please take this item and have a nice day~";
		next;
		getitem	504,30;	//White Potion
		getitem	645,25;	//Concentration potion
		getitem	14533,4;	//Field Manual
		getitem	14232,10;	//ygg berry box(10)
		getitem	4142,1;	//Doppelganger Card
		set #PlayerRecievedFreebies, 1;
		mes "See you soon~";
		close;
	}
}
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...