Jump to content
  • 0
Takuyakii

NPC Registration

Question

Can i request for this script

 

NPC Registration

 

1. You have to be level 20 for you to allowed to register on that npc.

2. That npc have list of all registered.

3. i want it to be permanent, what i mean is i found a script like this but everytime i use @reloadscript the list will be deleted 

4. Thanks in advance

btw here's the script 

set .end,0;
	while(.end!=1){
	mes "[Sign up NPC]";
	mes "Want to sign up ?!";
	mes	"^6666ff^000000";
		for(set [email protected],getarraysize([email protected]$); [email protected] != -1;){
			mes [email protected]$[[email protected]];
			set [email protected], [email protected] -1;
			}
			next;
			set .signmenu$,"Yes, Sign my name:Leave it alone";
			if(getgmlevel()>=99){set .signmenu$, .signmenu$ + ":^ff0000Wipe the list^000000"; }
			switch(select(.signmenu$)){
			case 1:
				mes "[Sign up NPC]";
				mes "You have signed up.";
				if([email protected] % 2 == 1) {
				set [email protected]$[[email protected]], "^6666ff["+gettimestr("%H:%M",21)+"]^000000 ^ff0000"+ strcharinfo(0) + " Signed Up";
				mes "^ff0000" + @var$ + "^000000";
				} else {
				set [email protected]$[[email protected]], "^6666ff["+gettimestr("%H:%M",21)+"]^000000 "+strcharinfo(0) + " Signed Up";
				}
				set [email protected], [email protected] + 1;
				close;
			case 2:
				close;
			case 3:
				set [email protected],0;	
				deletearray [email protected]$[0],getarraysize([email protected]$);
				set [email protected]$[0],"";
				mes "They have been erased.";
				break;
		}
	}
	close;
	
	OnInit:
	waitingroom "Sign up NPC",0;
	set [email protected],0;
	set [email protected]$[0],"";
	end;

 

Edited by Takuyakii
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Something like this?

prontera,150,150,6	script	Sample	100,{
	if (BaseLevel < 20) end;
	switch (select("Register", "View List", (getgmlevel() < 99 ? "" : "[^FF0000GM Menu^000000] Clear List"), "Exit")) {
		case 1:
			if (inarray($register$, strcharinfo(0)) != -1)
				mes "Already registered";
			else {
				mes "Done registration";
				$register$[getarraysize($register$)] = strcharinfo(0);
			}
			close;
		case 2:
			[email protected] = getarraysize($register$);
			if ([email protected])
				mes "No list";
			else {
				mes "Registration List";
				for ([email protected] = 0; [email protected] < [email protected]; [email protected]++)
					mes ([email protected]+1) + ". " + $register$[[email protected]];
			}
			close;
		case 3:
			deletearray $register$;
			end;
	}
}

 

  • Upvote 1
Link to comment
Share on other sites

  • 0
11 hours ago, Patskie said:

Something like this?

prontera,150,150,6	script	Sample	100,{
	if (BaseLevel < 20) end;
	switch (select("Register", "View List", (getgmlevel() < 99 ? "" : "[^FF0000GM Menu^000000] Clear List"), "Exit")) {
		case 1:
			if (inarray($register$, strcharinfo(0)) != -1)
				mes "Already registered";
			else {
				mes "Done registration";
				$register$[getarraysize($register$)] = strcharinfo(0);
			}
			close;
		case 2:
			[email protected] = getarraysize($register$);
			if ([email protected])
				mes "No list";
			else {
				mes "Registration List";
				for ([email protected] = 0; [email protected] < [email protected]; [email protected]++)
					mes ([email protected]+1) + ". " + $register$[[email protected]];
			}
			close;
		case 3:
			deletearray $register$;
			end;
	}
}

 

Thanks it works ^_^ 

Link to comment
Share on other sites

  • 0
On 8/17/2020 at 2:03 AM, Patskie said:

Something like this?

prontera,150,150,6	script	Sample	100,{
	if (BaseLevel < 20) end;
	switch (select("Register", "View List", (getgmlevel() < 99 ? "" : "[^FF0000GM Menu^000000] Clear List"), "Exit")) {
		case 1:
			if (inarray($register$, strcharinfo(0)) != -1)
				mes "Already registered";
			else {
				mes "Done registration";
				$register$[getarraysize($register$)] = strcharinfo(0);
			}
			close;
		case 2:
			[email protected] = getarraysize($register$);
			if ([email protected])
				mes "No list";
			else {
				mes "Registration List";
				for ([email protected] = 0; [email protected] < [email protected]; [email protected]++)
					mes ([email protected]+1) + ". " + $register$[[email protected]];
			}
			close;
		case 3:
			deletearray $register$;
			end;
	}
}

 

I wonder where the data will be save? I think if you restart your server the data/list will be lost.

Link to comment
Share on other sites

  • 0
1 hour ago, jayvz17 said:

I wonder where the data will be save? I think if you restart your server the data/list will be lost.

"$"      - A global permanent variable.
           They are stored by map-server in database table `mapreg`.

 

  • Upvote 1
Link to comment
Share on other sites

  • 0
2 hours ago, Patskie said:
"$"      - A global permanent variable.
           They are stored by map-server in database table `mapreg`.

 

I see. Thanks for clarification 🙂

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

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.