Jump to content
  • 0

Array's Valid Code


Mr BrycE

Question


  • Group:  Members
  • Topic Count:  125
  • Topics Per Day:  0.03
  • Content Count:  595
  • Reputation:   23
  • Joined:  02/23/12
  • Last Seen:  

prontera,154,139,4	script	Freebies	642,{

if( !#NEWBIE ) goto L_NEWBIE;
	mes "[ ^0000FF Freebies^000000 ]";	
	mes "Your @newbie command is : ^008800Available^000000";
	close;
OnInit:
	bindatcmd "newbie",strnpcinfo(3)+"::OnNewbie";
	setarray .@FREEBIESCODE$[0],
	"tJEPmtSoTDKC2C",
	"huHopok46L2vCw",
	"fhjyw5GwVBtqBS",
	"ZHsWP58YjFcfea",
	"VafHWrqZxrXXac";

L_NEWBIE:
	mes "[ ^0000FF  Freebies^000000 ]";
	mes "Please input the the code that our staff gave you, it is the proof that you acquire all the need conditions before getting our freebies";
	next;
	input .@freebiecode$;
	if (.@freebiecode$ != .@FREEBIESCODE$) {
	mes "[ ^0000FF Freebies^000000 ]";
	mes "It's either you mistype it or you really don't have the code";	
	close;
}
	mes "[ ^0000FF Freebies^000000 ]";
	mes "Congratulations!";
	mes "your @newbie command is now activated";
	set #NEWBIE,1;
	close;

OnNewbie:
if( !#NEWBIE ) goto L_NEWBIEDEACT;
if( #NEWBIE == 2 ) goto L_NEWBIEUSED;
	dispbottom "@newbie command used";
	getitem 2357,1;
	getitem 2524,1;
	getitem 2421,1;
	getitem 2115,1;
	getitem 20381,1;
	getitem 14545,5;
	rentitem 2741,604800;
	set #NEWBIE,2;

L_NEWBIEUSED:
	dispbottom "You already used the @newbie command";
	end;
	
L_NEWBIEDEACT:
	dispbottom "Your @newbie command is still deactivated";
	end;
}


}

im having problem with the array  and to this 

if (.@freebiecode$ != .@FREEBIESCODE$) {

well, i want the players to enter a valid code on the input, the possible codes are on the array to activate the newbie command..

the problem is i dunno how it can work...xD

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  125
  • Topics Per Day:  0.03
  • Content Count:  595
  • Reputation:   23
  • Joined:  02/23/12
  • Last Seen:  

i did what you ask.

 

even if i type "123" i'm still activating the newbie command ,without entering any of those possible codes. :(

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  52
  • Reputation:   6
  • Joined:  01/06/12
  • Last Seen:  

 

In the rAthena scripting language, variable names are not case sensitive.

 

from http://svn.rathena.org/svn/rathena/trunk/doc/script_commands.txt

 

You are literally asking them to input the 0th element of that variable, and then asking to see if it equals itself. 

 

Change the input variable name to .@free$ or something, and then implement Patskie's change.

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...