Takuyakii Posted August 16, 2020 Share Posted August 16, 2020 (edited) 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 August 16, 2020 by Takuyakii Quote Link to comment Share on other sites More sharing options...
0 Patskie Posted August 16, 2020 Share Posted August 16, 2020 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; } } 1 Quote Link to comment Share on other sites More sharing options...
0 Takuyakii Posted August 17, 2020 Author Share Posted August 17, 2020 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 ^_^ Quote Link to comment Share on other sites More sharing options...
0 jayvz17 Posted August 27, 2020 Share Posted August 27, 2020 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. Quote Link to comment Share on other sites More sharing options...
0 Patskie Posted August 27, 2020 Share Posted August 27, 2020 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`. 1 Quote Link to comment Share on other sites More sharing options...
0 jayvz17 Posted August 27, 2020 Share Posted August 27, 2020 2 hours ago, Patskie said: "$" - A global permanent variable. They are stored by map-server in database table `mapreg`. I see. Thanks for clarification Quote Link to comment Share on other sites More sharing options...
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 TakuyakiiLink to comment
Share on other sites