Jump to content

ToiletMaster

Members
  • Posts

    276
  • Joined

  • Last visited

Everything posted by ToiletMaster

  1. Hi everyone, i have a question to ask. is there any possibility to select from an array and make sure that the selection is distinct? for example if i set an array of setarray .random[0], 100,200,300,400,500,600,700,800,900,1000; Is there a possibility that if i pick a number from this array, that it will not be repeated anymore? a quick solution would be putting the number in a variable and checking it, but that's only if it works with 1 time checks, what if i had 5 different times i'm selecting from this array that requires a distinct selection.
  2. Hi everyone, i seem to be having an issue where the channels that i've configured for some reason, such as #global, #trade, #support, doesn't work for all players except for the administrator. For example, the administrator is able to chat to everyone in global, but for any other players, it'll state that you're typing too fast. I've tried downloading a fresh copy of rAthena with only the conf file import and no scripts and db amendments and the problem still persists, i've checked on the config and i can't find anything that players cannot chat via #global., I've set autojoin: true on the settings, follow by chat: yes, removed the delay or set delay to 1 but to no avail. Players can see the #global chat, but they just cant type it back. Hope someone is able to point me to the right direction. Thank you!
  3. Are you looking for the /str +number? Example /str+ 50 will add 50 into strength, same for Dex, luk, agi, and etc.
  4. Thanks! I wasn't aware that this was the specific command that I was looking for. I'm not sure how I missed as well ._. but thanks for clearing that up!
  5. Hey Chris! Thanks for taking the time to script that out, i've tested and it works great, however there seems to be a small little issue though, this is kinda the part that i'm stuck lol for( [email protected] = 0; [email protected] < getarraysize(.reqItemID1); [email protected]++) if(countitem(.reqItemID1[[email protected]]) < .reqItemQty1[[email protected]]){ mes "You have insufficient items"; The requirements doesn't jump directly to the 2nd requirements from here since .reqItemID1 is fixed i was hoping it'd be something like [email protected][[email protected]] followed by [email protected][[email protected]] so that it automatically rotates based on which selection i chose but, after trying out this one it doesn't work , generally hoping for a way to join 2 variables into one Oh and before i forget since you've removed the first array, then i guess this part has to start from 0 then , otherwise it'd skipped the first item for ([email protected] = 0; [email protected] < getarraysize(.itemID); [email protected]++) [email protected]$ = [email protected]$ + "~ "+ getitemname(.itemID[[email protected]]) + ":"; set [email protected],select( [email protected]$) - 1;
  6. Hey Chris! Thanks for the insight! I'll try out removing the switch and adjusting the menu. However I'd still like to know whether if its possible to combine them into one though, perhaps I can show what I plan to achieve? Cause each case requires me to copy and paste so I'm hoping to not copy and paste instead. I have a rough concept in mind but I just can't put my head on how to do it. I'll write it up once I'm back home. Thanks!
  7. Hi guys, The script currently works fine, however i'm hoping to get an opinion whether if the script below can be improved or better answer my query which is whether is it possible to join 2 variables into 1 ? Here's the NPC that i've made so far. mes "Select Equipment to Craft."; for ([email protected] = 1; [email protected] < getarraysize(.itemID); [email protected]++) [email protected]$ = [email protected]$ + "~ "+ getitemname(.itemID[[email protected]]) + ":"; switch(select( [email protected]$ ) ){ case 1: [email protected] = 1; mes "Item Preview: <ITEM>"+getitemname(.itemID[[email protected]])+"<INFO>"+.itemID[[email protected]]+"</INFO></ITEM>"; mes "===================="; for([email protected] = 0; [email protected] < getarraysize(.reqItemID1); [email protected]++){ mes "^FF0000"+countitem(.reqItemID1[[email protected]])+"^000000 / "+.reqItemQty1[[email protected]]+ " ~ "+getitemname(.reqItemID1[[email protected]]); } mes "^FF0000"+callfunc("F_InsertComma",Zeny)+" / "+callfunc("F_InsertComma",.Zeny[[email protected]])+" Zeny"; next; mes "Do you wish to continue?"; switch(select("Let me think about it: Yes, create item.")){ case 1: mes "Come back anytime"; close; case 2: if(Zeny <= .Zeny[[email protected]]){ mes "You have insufficient Zeny!"; close;} for( [email protected] = 0; [email protected] < getarraysize(.reqItemID1); [email protected]++){ if(countitem(.reqItemID1[[email protected]]) < .reqItemQty1[[email protected]]){ mes "You have insufficient items"; close; } } for( [email protected] = 0; [email protected] < getarraysize(.reqItemID1); [email protected]++){ delitem .reqItemID1[[email protected]],.reqItemQty1[[email protected]];} Zeny -= .Zeny[[email protected]]; getitem .itemID[[email protected]],1; mes "Here you go!"; close; } // mini case end case 2: [email protected] = 2; mes "Item Preview: <ITEM>"+getitemname(.itemID[[email protected]])+"<INFO>"+.itemID[[email protected]]+"</INFO></ITEM>"; mes "===================="; for([email protected] = 0; [email protected] < getarraysize(.reqItemID2); [email protected]++){ mes "^FF0000"+countitem(.reqItemID2[[email protected]])+"^000000 / "+.reqItemQty2[[email protected]]+ " ~ "+getitemname(.reqItemID2[[email protected]]); } mes "^FF0000"+callfunc("F_InsertComma",Zeny)+" / "+callfunc("F_InsertComma",.Zeny[[email protected]])+" Zeny"; next; mes "Do you wish to continue?"; switch(select("Let me think about it: Yes, create item.")){ case 1: mes "Come back anytime"; close; case 2: if(Zeny <= .Zeny[[email protected]]){mes "You have insufficient Zeny!";close;} for( [email protected] = 0; [email protected] < getarraysize(.reqItemID2); [email protected]++){ if(countitem(.reqItemID2[[email protected]]) < .reqItemQty2[[email protected]]){ mes "You have insufficient items"; close; } } for( [email protected] = 0; [email protected] < getarraysize(.reqItemID2); [email protected]++){ delitem .reqItemID2[[email protected]],.reqItemQty2[[email protected]];} Zeny -= .Zeny[[email protected]]; getitem .itemID[[email protected]],1; mes "Here you go!"; close; } OnInit: setarray .itemID, 0, 2589, 18600; setarray .Zeny, 0, 50000000,20000000; //item requirement for each items //Fallen Angel Wing setarray .reqItemID1, 2573, 7441,916,949, 1039, 7063,7511,983,982; setarray .reqItemQty1, 1, 300, 300, 300, 300, 100, 50, 20, 20; //Cat Ear Beret setarray .reqItemID2, 5172, 714, 5057, 919, 7161, 1059, 983; setarray .reqItemQty2, 1, 1, 1, 100, 200, 200, 5; end; } currently i copy and paste case 1 and case 2 and only changing the [email protected] variable. If i can add the use .reqitemID + [email protected] together then i'd be able to save much more on this one. Would appreciate on your feedback, thanks! P.S., the itemID being 0 for the first array is kinda because i wanna align the case with the [email protected] >_>
  8. Whenever there's an input for string with SQL, you should always try to use escape_sql command to make it safe. As long as you parse the variable with this then it should be fine, I've not tested this entirely though since I'm on my phone but it should work.
  9. Hope you don't mind if I divert from the original request of this thread, however, Correct me if I'm wrong, doesn't this part here make this vulnerable to SQL injection? while it does have a check to prevent groupID to be 4 and above to be able to interact with the NPC, however if it falls into the wrong hands they could do quite a bit of damage if they really wanted.
  10. Thanks a lot @Nitrous , I've tested this and it works perfectly!
  11. Hi everyone, i seem to be having an issue, as we store permanent character variables in char_reg_num, i have a script that deletes this on a timed basis. query_sql( "DELETE FROM `char_reg_num` WHERE `key`='variable' " ); However, the problem i find out is that the variables only saves once the person logs out, thus if the person interacts with the NPC and for example gets an additional ranking, it'll be the old value + new value together. For example Value before Scripts deletes the variables Variable = 100 If the person interacts with the NPC and let's say the variable adds 10 without logging off, Variable = 110 If the person interacts with the NPC and let's say the variable adds 10 after logging off Variable = 10 Is there any way to force it to clear the values? This is because i'm using a SQL based ranking for this and players are able to add that variable by themselves. Similar to Rachel's donation quest to open the gateway but instead with a ranking.
  12. You need to add the quest description in your questid2display.txt in your grf/data folder. Follow the format there and add it in there and it should work in game.
  13. Just purchased his services on a specific concept I have in mind for a script and he did the work pretty quickly. He adjusted to the needs and listens to your request accordingly. Great person to work with and would definitely recommend to everyone.
  14. I'm not sure entirely on this as i had someone else to come in and take a look and they mentioned it was something to do with my host unfortunately, but i've moved it to another server now and it works fine. thanks for the help though!
  15. Cyro helped assessed my situation and even though the issue seems to be on my hosting side, he gave a lot of valuable advices and extremely friendly. For anyone thinking about purchasing his services, you'll definitely be amazed by the professionalism given. Cheers for the assistance!
  16. Thanks for the reply! i've tried that but it doesn't seem to work. Currently the entire permission group level for that directory is 0, which in this case is root, i've checked on my previous host grouping and it was 99 instead. and 99 would also mean under the grouping file for the old host. nobody:x:99:99:Nobody:/:/sbin/nologin
  17. Hi there guys, i seem to be having an error upon reinstalling my flux cp, i've move host for this and it works great for the first host. for the second host however, i do get the error below, i've did the change in terms of chmod 0600 for the respective files that was stated below but it didn't work at all. I've even tried making the entire directory 777 to test it out but it still throws the same error. I've tested a number of times but i'm not able to figure this out, would appreciate if someone could point me to the right direction on what i'm missing out here >_>, doing a search on google gave me several results but not the exact one that i'm looking unfortunately
  18. initnpctimer will set the timer back to 0 however if you stopnpctimer and then startnpctimer, it'll resume where it stopped
  19. Tested and working perfectly! Thank you very much for the help!
  20. Hi Capuche, I've tested this and for some reason it doesn't seem to work, i've changed the parameters and set the npc to give the timer but unfortunately it doesn't seem to work for some reason, it doesn't do any count upon dying Suprisingly i've tested this as well and it doesn't seem to work for some reason, i've added my instance ID in together with the name of the map but unfortunately it doesn't work either, is it possible if you could where it went wrong? - script Controller -1,{ OnPcDieEvent: if(instance_mapname(strcharinfo(3)) != instance_mapname("map_name",100) ){end;} if(.chance == 3){ mapwarp instance_mapname("map_name",100),"prontera",150,150; end;} .chance++; mapannounce strnpcinfo(4),strcharinfo(0)+" has died! you only have "+(3 - .chance)+" lives remaining.",bc_all; end; } my instance ID in the instance_db is 100, i've set that here and it doesn't work, alternatively i've tried with the name of the instance as well but it doesn't work either
  21. Thanks for the alternative! I'll give this a try and see if this is possible tonight. That's interesting! I wasn't aware of that too! I'll give this a try as well and see if that works. Though generally since onPCDieEvent is a global call, I guess would it make sense to attach timers on their players itself like Capuche mentioned?
  22. if that were really the case, would there be any alternatives on how to be able to do the same thing?
  23. Hi Guys, i've been trying to figure out this for quite sometime but after searching around and tinkering around i just can't seem to find out where is the issue here. this works outside of the instance but within the instance, i get a weird error from the console (map_mapname2mapid) mapindex_name2id: Map "" not found in index list! I'm not sure how it works since it's kinda my first time using OnPcDieEvent in instances. Would appreciate if someone could point me to the right direction! Generally what I'm trying to achieve is that once you go in and die 3 times, your entire party should automatically get warped out. - script Controller -1,{ OnPcDieEvent: if(instance_mapname(strcharinfo(3)) != instance_mapname("instance") ){end;} if(.chance == 3){ mapwarp instance_mapname("instance"),"prontera",150,150; end;} .chance++; mapannounce strnpcinfo(4),strcharinfo(0)+" has died! you only have "+(3 - .chance)+" lives remaining.",bc_all; end; }
  24. You've just blew my mind! I completely forgotten about that portion. Now I see exactly how it works out! Thank you so much for making me understand! I fully understand on how it works now
  25. First and foremost, would like to apologize for the late reply, got caught up yesterday and couldn't respond back to the topics. Thank you for sharing that, i understand that atoi changes from string to integer, but mainly on the uses of it as i can't seem to imagine on how it would be useful. Hi @Z3R0, Thanks for the example! This makes it easier for me to understand, i wasn't aware that this was possible. Off Topic, does your scripting for dummies cover this portion? i saw a little bit earlier on but it was mainly on the basics of the scripting, would love to see if you'd cover a little bit more on this topic if you have the time! Kudos
×
×
  • Create New...

Important Information

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