Rendril Posted October 29, 2009 Report Posted October 29, 2009 Add allowed ID's into the array, once the quest is finished it gives the "end key" to prevent a user from starting it again. Could be done using a storage but that would require a complex interface, in my opinion this is a simple and clean solution. [code] @vz = "rendrilrevant-";//define your key prefix @va = array(123451,1214,6326,23423,6342,23089);//array that holds ID's of those you will allow //check if user's ID is in the array and that they don't hold the end key if(in_array(uv('id'), @va) && (!mds_has_rpcq_keys(@vz . "end-key"))){ echo @content[1]; } else{ echo "You do not have access to this quest."; } [/code] Quote
I am Bored Posted October 29, 2009 Report Posted October 29, 2009 (edited) is it possible to have seperate things displayed for seperate ids? as i have 4 levels of something i need to set up on the same item, with different id's for each, also if a storage is accessable from any item then that would work much better for quests, as i am pretty sure most don't put an entire quest on one page.... and even then that isn't enough to do it with. oh and that code does work as is, only have to take out the comments and it works just fine. except that i can't figure out how to put a capitol letter in..... and how do you insert a flash object? Edited October 29, 2009 by I am Bored Quote
Rendril Posted October 29, 2009 Author Report Posted October 29, 2009 (edited) You could try with 4 seperate arrays: [code] @va = array(123451,1214,6326); @vb = array(4362,62,34737); @vc = array(1515,1231,2626); @vd = array(2752,1257,2579); [/code] Then build a specific if-block for each array, effectively copying the code fom the initial post 4 times. Storages do work across multiple items, that is the "ao" part of the types. As for showing capital letters, I suggest echo'ing out from the @content for now. Edited October 29, 2009 by Rendril Quote
I am Bored Posted October 29, 2009 Report Posted October 29, 2009 (edited) [quote name='Rendril' date='29 October 2009 - 02:17 PM' timestamp='1256843831' post='46083'] You could try with 4 seperate arrays: [code] @va = array(123451,1214,6326); @vb = array(4362,62,34737); @vc = array(1515,1231,2626); @vd = array(2752,1257,2579); [/code] Then build a specific if-block for each array, effectively copying the code fom the initial post 4 times. Storages do work across multiple items, that is the "ao" part of the types. As for showing capital letters, I suggest echo'ing out from the @content for now. [/quote] well i figured out the content part, and i got the flash working, as the content likes good old html better than the scripting part..... and what do you mean by the AO part? i will try the multi arrays.... is it possible to select those within a certain id range? oh and just so you know, there is only 1 id that is under 100, and that is king manu, the next is muratus del mur...... or wait.... did live help survive? if live help did then it has id 2, but there is no account with an id of 62 and how could i get rid of the end key check? because i don't need that for my quest, and i think it will be much easier for me to work with without the checking of the end key Edited October 29, 2009 by I am Bored Quote
Rendril Posted October 29, 2009 Author Report Posted October 29, 2009 The storages can have different types: ao = all objects. Refer to the script manual section for more info. Is this what you mean for between a certain ID range? [code] @vl = 1000;//lower bound @vu = 2000;//upper bound //check that user is is bewteen upper and lower bounds if((uv('id') > @vl)) && (uv('id') < @vu)) { echo "Your ID was within the correct range." } [/code] You might notice how the expressions are wraped in brackets when they usually wouldn't be, this is because the parser might get a restriction on "&@" and I find t jsut makes managing the order of precedence easier. I simply mashed my keyboard to generate different ID's for the arrays, take no notice of whether they are valid ID's. Maybe the script was written when ID 64 still existed Quote
I am Bored Posted October 29, 2009 Report Posted October 29, 2009 (edited) i might as well say i gave up reading that section, i don't have a long enough attention span to be able too.... wonder if we can change the size of the frame it is in..... it would help if i could fit 1 line of text and my creature book in the frame...... and in game i am currently at marind's roundabout, working on my page there. your pid is 44582 right? Edited October 29, 2009 by I am Bored Quote
Rendril Posted October 29, 2009 Author Report Posted October 29, 2009 That's why browser's come with search functions. Try ctrl+f and "aotu" Maybe we can get to assign frame parameters before it is created, that way we specify height, borders, backgrounds etc instead of js workarounds. Quote
Root Admin Chewett Posted October 29, 2009 Root Admin Report Posted October 29, 2009 [quote name='I am Bored' date='29 October 2009 - 07:25 PM' timestamp='1256844306' post='46086'] oh and just so you know, there is only 1 id that is under 100, and that is king manu, the next is muratus del mur...... or wait.... did live help survive? if live help did then it has id 2, but there is no account with an id of 62 [/quote] 4 accounts under id 100, you might want to check them out, they are intresting Quote
I am Bored Posted October 30, 2009 Report Posted October 30, 2009 but i only know of mur and live help.... hmmmm... would the others be npcs? although i thought they were the first ones after mur's.... and a few others.... well one of the first... Quote
Grido Posted October 30, 2009 Report Posted October 30, 2009 3 is ''Default Player'' (which i think has been around a while) and 4 is ''Mur..'' (which is more recent) Yes, i tend to pay attention to random things like this Quote
Root Admin Chewett Posted October 30, 2009 Root Admin Report Posted October 30, 2009 [quote name='Grido' date='30 October 2009 - 07:15 PM' timestamp='1256930131' post='46152'] 3 is ''Default Player'' (which i think has been around a while) and 4 is ''Mur..'' (which is more recent) Yes, i tend to pay attention to random things like this [/quote] ah, dont spoil it, i love the description of Mur.. Quote
I am Bored Posted November 7, 2009 Report Posted November 7, 2009 well the last time i checked was a long time ago, and at that point, id's 3&4 didn't exist Quote
Burns Posted July 22, 2014 Report Posted July 22, 2014 (edited) Probably not the most elegant solution, but here's a little magic to have a quest restricted by id without having the guy who coded the item do anything when new people need to be added: @vx=mds_storage('xyzparticipants', 'aoau'); @vb=@storage[@vx]; if(@vb == null) {@vb = array();} if (isset(@input['add'])){ array_push(@vb, @input['id']); @storage[@vx]=@vb;} if (in_array(uv('id'), array(53832, 131999))){//array with the people who can edit the list foreach(@vb as @vv) echo "@vv, ";//print the current list echo @content[x];//show the 'Add'-button } if(in_array(uv('id'), @vb)){echo @content[y];} //shows the text to people on the list <form method="post" action=""> Enter ID here: <input name="id" type="text" /><br /> <input name="add" type="submit" value="Add"/> </form> Edited July 22, 2014 by Burns dst and Sir Blut 2 Quote
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.