simplexjay2 Posted July 26, 2015 Group: Members Topic Count: 56 Topics Per Day: 0.01 Content Count: 224 Reputation: 4 Joined: 02/09/12 Last Seen: April 20, 2024 Share Posted July 26, 2015 - script StorageInfo -1,{ OnSettings: mes "[Storage Security Info]"; mes "Select an option"; next; if(#StoragePassword > 1); switch(select("Change Password:Forgot Password:Close")) { case 1: mes "[Storage Security Info]"; mes "Input current password"; next; input .@pass; if (.@pass != #StoragePassword) {mes "Invalid password, please try again."; close;} mes "[Storage Security Info]"; mes "Input New Password"; next; input .@passn; if (.@passn < 1000 || .@pass > 9999) {mes "Invalid password, please try again ^FFF000(1000 - 9999)^000000."; close;} mes "[Storage Security Info]"; mes "Confirm New Password"; next; input .@passnc; if (.@passnc != .@passn) {mes "Please try again."; close;} set #StoragePassword, .@passn; case 2: mes "[Storage Security Info]"; mes "Please input your account email."; next; input .@email$; query_sql "SELECT email FROM login WHERE account_id = "+ getcharid(3) +";",.@emaill$[0]; if (.@email$ != .@emaill$[0]) {mes "Invalid email, please try again"; close;} mes "[Storage Security Info]"; mes "Input New Password"; next; input .@passn; if (.@passn < 1000 || .@pass > 9999) {mes "Invalid password, please try again ^FFF000(1000 - 9999)^000000."; close;} mes "[Storage Security Info]"; mes "Confirm New Password"; next; input .@passnc; if (.@passnc != .@passn) {mes "Please try again."; close;} set #StoragePassword, .@passn; case 3: close; else if (!#StoragePassword) { switch(select("Set Password:Close")) { case 1: mes "[Storage Security Info]"; mes "Input New Password"; next; input .@passn; if (.@passn < 1000 || .@pass > 9999) {mes "Invalid password, please try again ^FFF000(1000 - 9999)^000000."; close;} mes "[Storage Security Info]"; mes "Confirm New Password"; next; input .@passnc; if (.@passnc != .@passn) {mes "Please try again."; close;} set #StoragePassword, .@passn; } case 2: close; } } } GIves me error npc_event: event not found [storageInfo::Onsettings] Quote Link to comment Share on other sites More sharing options...
Lelouch vi Britannia Posted July 27, 2015 Group: Members Topic Count: 45 Topics Per Day: 0.01 Content Count: 715 Reputation: 84 Joined: 01/05/12 Last Seen: April 10, 2023 Share Posted July 27, 2015 Try this... - script StorageInfo -1,{ OnSettings: if(!#StoragePassword){ switch(select("Set Password:Close")){ case 1: mes "[Storage Security Info]"; mes "Input New Password"; next; input .@passn; if (.@passn < 1000 || .@pass > 9999){ mes "Invalid password, please try again ^FFF000(1000 - 9999)^000000."; close; } mes "[Storage Security Info]"; mes "Confirm New Password"; next; input .@passnc; if (.@passnc != .@passn){ mes "Please try again."; close; } set #StoragePassword, .@passn; case 2: close; } } else { mes "[Storage Security Info]"; mes "Select an option"; next; if(#StoragePassword > 1); switch(select("Change Password:Forgot Password:Close")){ case 1: mes "[Storage Security Info]"; mes "Input current password"; next; input .@pass; if (.@pass != #StoragePassword){ mes "Invalid password, please try again."; close; } mes "[Storage Security Info]"; mes "Input New Password"; next; input .@passn; if (.@passn < 1000 || .@pass > 9999){ mes "Invalid password, please try again ^FFF000(1000 - 9999)^000000."; close; } mes "[Storage Security Info]"; mes "Confirm New Password"; next; input .@passnc; if (.@passnc != .@passn){ mes "Please try again."; close; } set #StoragePassword, .@passn; case 2: mes "[Storage Security Info]"; mes "Please input your account email."; next; input .@email$; query_sql "SELECT email FROM login WHERE account_id = "+ getcharid(3) +";",.@emaill$[0]; if (.@email$ != .@emaill$[0]){ mes "Invalid email, please try again"; close; } mes "[Storage Security Info]"; mes "Input New Password"; next; input .@passn; if (.@passn < 1000 || .@pass > 9999){ mes "Invalid password, please try again ^FFF000(1000 - 9999)^000000."; close; } mes "[Storage Security Info]"; mes "Confirm New Password"; next; input .@passnc; if (.@passnc != .@passn){ mes "Please try again."; close; } set #StoragePassword, .@passn; case 3: close; } } } Quote Link to comment Share on other sites More sharing options...
simplexjay2 Posted July 27, 2015 Group: Members Topic Count: 56 Topics Per Day: 0.01 Content Count: 224 Reputation: 4 Joined: 02/09/12 Last Seen: April 20, 2024 Author Share Posted July 27, 2015 I GOT THIS PROBLEM WHEN I USE @storageinfo Quote Link to comment Share on other sites More sharing options...
Lelouch vi Britannia Posted July 27, 2015 Group: Members Topic Count: 45 Topics Per Day: 0.01 Content Count: 715 Reputation: 84 Joined: 01/05/12 Last Seen: April 10, 2023 Share Posted July 27, 2015 (edited) Are you using this? https://rathena.org/board/topic/102521-storage-password-storageinfo/Mine is working fine... Ok if you are having issues with this just follow what i did...src/map/atcommand.c Find this /*========================================== * *------------------------------------------*/ ACMD_FUNC(storage) { nullpo_retr(-1, sd); if (sd->npc_id || sd->state.vending || sd->state.buyingstore || sd->state.trading || sd->state.storage_flag) return -1; if (storage_storageopen(sd) == 1) { //Already open. clif_displaymessage(fd, msg_txt(sd,250)); return -1; } clif_displaymessage(fd, msg_txt(sd,919)); // Storage opened. return 0; } and replace it with this /*================================================ *Storage Modifications By Nova [PromisE rAthena] *------------------------------------------------*/ ACMD_FUNC(storage) { int value, password; if( sd->npc_id || sd->state.vending || sd->state.buyingstore || sd->state.trading || sd->state.storage_flag ) return -1; value = pc_readaccountreg(sd,"#StoragePassword"); if (!value) { storage_storageopen(sd); clif_displaymessage(fd, "Storage opened."); clif_displaymessage(fd, "For more security, please use @storageinfo to set a password"); return 0; } else { if ( !message || !*message || sscanf(message,"%d", &password ) < 1 ) { clif_displaymessage(fd, "@storage <Password>"); clif_displaymessage(fd, "If you forgot your password you can use @storageinfo"); return -1; } if (password != value) { clif_displaymessage(fd, "Incorrect Password " ); clif_displaymessage(fd, "If you forgot your password you can use @storageinfo"); return -1; } storage_storageopen(sd); clif_displaymessage(fd, "Storage opened."); return 0; } } ACMD_FUNC(storageinfo) { if( sd->npc_id || sd->state.vending || sd->state.buyingstore || sd->state.trading) return -1; npc_event(sd,"StorageInfo::OnSettings",0); return 0; } Find this ACMD_DEF(load), ACMD_DEF(speed), ACMD_DEF(storage), and add ACMD_DEF(storageinfo), below the ACMD_DEF(storage), like this ACMD_DEF(load), ACMD_DEF(speed), ACMD_DEF(storage), ACMD_DEF(storageinfo), npc/custom/storageinfo.txt - script StorageInfo -1,{ OnSettings: if(!#StoragePassword){ switch(select("Set Password:Close")){ case 1: mes "[Storage Security Info]"; mes "Input New Password"; next; input .@passn; if (.@passn < 1000 || .@pass > 9999){ mes "Invalid password, please try again ^FFF000(1000 - 9999)^000000."; close; } mes "[Storage Security Info]"; mes "Confirm New Password"; next; input .@passnc; if (.@passnc != .@passn){ mes "Please try again."; close; } set #StoragePassword, .@passn; case 2: close; } } else { mes "[Storage Security Info]"; mes "Select an option"; next; if(#StoragePassword > 1); switch(select("Change Password:Forgot Password:Close")){ case 1: mes "[Storage Security Info]"; mes "Input current password"; next; input .@pass; if (.@pass != #StoragePassword){ mes "Invalid password, please try again."; close; } mes "[Storage Security Info]"; mes "Input New Password"; next; input .@passn; if (.@passn < 1000 || .@pass > 9999){ mes "Invalid password, please try again ^FFF000(1000 - 9999)^000000."; close; } mes "[Storage Security Info]"; mes "Confirm New Password"; next; input .@passnc; if (.@passnc != .@passn){ mes "Please try again."; close; } set #StoragePassword, .@passn; case 2: mes "[Storage Security Info]"; mes "Please input your account email."; next; input .@email$; query_sql "SELECT email FROM login WHERE account_id = "+ getcharid(3) +";",.@emaill$[0]; if (.@email$ != .@emaill$[0]){ mes "Invalid email, please try again"; close; } mes "[Storage Security Info]"; mes "Input New Password"; next; input .@passn; if (.@passn < 1000 || .@pass > 9999){ mes "Invalid password, please try again ^FFF000(1000 - 9999)^000000."; close; } mes "[Storage Security Info]"; mes "Confirm New Password"; next; input .@passnc; if (.@passnc != .@passn){ mes "Please try again."; close; } set #StoragePassword, .@passn; case 3: close; } } } npc/scripts_custom.conf npc: npc/custom/storageinfo.txt NOTE: Dont forget to recompile your trunk Edited July 27, 2015 by Lelouch vi Britannia 1 Quote Link to comment Share on other sites More sharing options...
simplexjay2 Posted July 27, 2015 Group: Members Topic Count: 56 Topics Per Day: 0.01 Content Count: 224 Reputation: 4 Joined: 02/09/12 Last Seen: April 20, 2024 Author Share Posted July 27, 2015 It's ok now i got problem with the npc on the rar file i used your post thanx alot Quote Link to comment Share on other sites More sharing options...
Question
simplexjay2
GIves me error npc_event: event not found [storageInfo::Onsettings]
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.