xrein Posted June 26, 2013 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 6 Reputation: 0 Joined: 04/25/13 Last Seen: March 22, 2018 Share Posted June 26, 2013 is there a script that allow me to connect to database so that i can select all data i need then display it on the npc?? thanks --- im planning to make a npc that use @slaveclone then slaveclone all existing characters on the database Quote Link to comment Share on other sites More sharing options...
Euphy Posted June 26, 2013 Group: Members Topic Count: 72 Topics Per Day: 0.02 Content Count: 2997 Reputation: 1132 Joined: 05/27/12 Last Seen: June 1, 2017 Share Posted June 26, 2013 Query_sql Quote Link to comment Share on other sites More sharing options...
xrein Posted June 26, 2013 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 6 Reputation: 0 Joined: 04/25/13 Last Seen: March 22, 2018 Author Share Posted June 26, 2013 thanks for the fast reply, but what is the use of the next variables after the sql query?? here is my code, but when i clicked my npc it wont talk haha set .@nb, query_sql("SELECT `name`, `account_id` FROM `char` ORDER BY `account_id` ASC LIMIT 5", .@name$, .@account_id); mes "[Character List]"; for(set .@i,1; .@i <= .@nb; set .@i,.@i+1){ mes .@i+". "+.@name$[0]+" ("+.@account_id[0]+")"; } Quote Link to comment Share on other sites More sharing options...
Capuche Posted June 27, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted June 27, 2013 The first value start at index 0 to index ( .@nb - 1 ) in yours variables so you need for(set .@i,0; .@i < .@nb; set .@i,.@i+1){ mes (.@i+1)+". "+.@name$[.@i]+" ("+.@account_id[.@i]+")"; } Quote Link to comment Share on other sites More sharing options...
xrein Posted June 27, 2013 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 6 Reputation: 0 Joined: 04/25/13 Last Seen: March 22, 2018 Author Share Posted June 27, 2013 wow, thanks sir capuche how about dynamic menu?? is it possible to make a dynamic menu using for loop? Quote Link to comment Share on other sites More sharing options...
Capuche Posted June 27, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted June 27, 2013 A menu to select one name? for(set .@i,0; .@i < .@nb; set .@i,.@i+1){ mes (.@i+1)+". "+.@name$[.@i]+" ("+.@account_id[.@i]+")"; .@menu$ = .@menu$ + "+.@name$[.@i]+" ("+.@account_id[.@i]+"):"; } .@s = select( .@menu$ ) -1; Quote Link to comment Share on other sites More sharing options...
Question
xrein
is there a script that allow me to connect to database so that i can select all data i need then display it on the npc??
thanks
---
im planning to make a npc that use @slaveclone then slaveclone all existing characters on the database
Link to comment
Share on other sites
5 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.