Jump to content

Ruthven Ravenhurst

Resident
  • Posts

    491
  • Joined

  • Last visited

Everything posted by Ruthven Ravenhurst

  1. It is in the touch event, as it was in your original script
  2. My problem is I dont find a way how to make a Dialog before he pays I want the player clicks on the prim become a Dialog with 1 week , 2 week aso and after clicking 1 week to example he paid 100L$ to me
  3. I don't understand what you mean. Are you saying they should pay $100 before receiving the dialog to choose the number of weeks, then pay again?
  4. I assume (after translating "woche") that you are intending to make a script for paying rent for a number of weeks. Here's what I came up with after re-writing your script. I'm not sure what the other scripts you have named are supposed to do. I assume they have some sort of countdown after being activated, but unless you have a way to reset this script set in those, you may need to add a countdown in this script in order for it to reset and allow someone to pay rent again. list prices = [100, 120, 140, 160];list buttons = ["1 Woche", "2 Wochen", "3 Wochen", "4 Wochen"];list scripts = ["woche 1", "woche 2", "woche 3", "woche 4"];string dialogInfo = "\nPlease make a choice.";key ToucherID;integer dialogChannel;integer listenHandle;integer index;integer price;integer active = FALSE; default{on_rez(integer start_param){llResetScript();}state_entry(){llSetPayPrice(PAY_HIDE, [PAY_HIDE ,PAY_HIDE, PAY_HIDE, PAY_HIDE]);llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);}run_time_permissions(integer perm){if(perm & PERMISSION_DEBIT)state cash;}}state cash{ state_entry() { dialogChannel = -1 - (integer)("0x" + llGetSubString( (string)llGetKey(), -7, -1) ); } touch_start(integer num_detected) { if(!active) { ToucherID = llDetectedKey(0); llDialog(ToucherID, dialogInfo, buttons, dialogChannel); listenHandle = llListen(dialogChannel, "", ToucherID, ""); } else { llInstantMessage(llDetectedKey(0), "Sorry the system is not available at this moment.");//or whatever message you want when week(s) are already paid for }} listen(integer channel, string name, key id, string message) { // Turn off the listener at a convenient common junction. You can usually avoid coding this multiple times. llListenRemove(listenHandle); index = llListFindList(buttons, [message]);//look in the list of buttons for the message index if (index >= 0)//if the message exists in the button list { price = llList2Integer(prices, index);//use the extracted index to get the intended price from the list of prices llSay(0,"Pay Price Set To " + (string)price+" for "+message+ ". Please right-click and pay" ); llSetPayPrice(PAY_HIDE, [price ,PAY_HIDE, PAY_HIDE, PAY_HIDE]);//set the intended price } }money(key payer, integer Amount){ integer test = llListFindList(prices, [Amount]);//checks to make sure amount received is valid if(test >= 0) { string script = llList2String(scripts, test);//find the script name according to the index found above llSetScriptState(script, TRUE);//set the script named to active llInstantMessage(payer, "You have paid for " + llList2String(buttons, test)); active = TRUE;//set to active so that future touches are not used } else { llInstantMessage(payer, "Amount invalid, please try again.");//If the amount paid isn't in the list of prices, tells avatar, and refunds them llGiveMoney(payer, Amount); } llSetPayPrice(PAY_HIDE, [PAY_HIDE ,PAY_HIDE, PAY_HIDE, PAY_HIDE]);}}
  5. first, you have: key id = llDetectedKey(0); in the on_rez event, nothing is "detected" there, so that won't do anything. second, you're setting the pay price twice, not sure why. any money paid to the object goes to the owner of the object, regardless of the script. the touch event is allowing anyone to touch it, receive the dialog menu, and make a choice. after they make their choice, the listen event is paying them the money according to the button they press. if you can explain a little more on what you're trying to acheive, I, or someone else might be able to help more
  6. I did see that, I just wasn't sure how to test that against the group of the avatar, but I looked in the wiki more, and found: llSameGroup-Usefull Snippets /* By Aryn Gellner pos - position (in region coordinates) to check against.*//* Additional Land Owner Test added by Ruthven Willenov*/ integer is_rezzable(vector pos){ list details = llGetParcelDetails(pos, [PARCEL_DETAILS_GROUP, PARCEL_DETAILS_OWNER]); key group_id = llList2Key(details, 0); key owner_id = llList2Key(details, 1); integer parcel_flags = llGetParcelFlags(pos); if(owner_id != llGetOwner()) { if(parcel_flags & PARCEL_FLAG_ALLOW_CREATE_OBJECTS) { return TRUE; } else if((parcel_flags & PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS) && llSameGroup(group_id)) { return TRUE; } else { return FALSE; }} else{return TRUE;}}
  7. Here's basically the sam script that Inulla posted, but with fewer lines: vector cut = <0.5, 1.0, 0.0>;vector twist = <0.0, 0.0, 0.0>;vector dimple = <0.0, 1.0, 0.0>;list hollow = [0.0, 0.95];integer toggle;default{ state_entry() { llSetTimerEvent(2.0); llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_TYPE, PRIM_TYPE_SPHERE,PRIM_HOLE_DEFAULT, cut, llList2Float(hollow,0), twist, dimple]); } timer() { llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_TYPE, PRIM_TYPE_SPHERE,PRIM_HOLE_DEFAULT, cut, llList2Float(hollow, toggle = !toggle), twist, dimple]); }} And this one uses steps to slowly change the hollow amount vector cut = <0.5, 1.0, 0.0>;vector twist = <0.0, 0.0, 0.0>;vector dimple = <0.0, 1.0, 0.0>;float hstep;float solid = 0.0;float hollow = 0.95;integer toggle;integer steps = 5;default{ state_entry() { llSetTimerEvent(2.0); llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_TYPE, PRIM_TYPE_SPHERE,PRIM_HOLE_DEFAULT, cut, solid, twist, dimple]); hstep = (hollow-solid)/steps; } timer() { integer i; float temphollow = llList2Float(llGetPrimitiveParams([PRIM_TYPE]),3); do llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_SPHERE,PRIM_HOLE_DEFAULT, cut,temphollow += hstep, twist, dimple]);//using llSetLinkPrimitiveParams here made it still too fast, unless you use more steps, or add a llSleep while ((++i) < steps); hstep = -hstep; }}
  8. Hmm, so what I'm understanding is, it doesn't check if that specific avatar has permissions, just what the parcel settings are?
  9. Old post, but: Another suggestion is the bounce mask, it won't make them die, but bounce upwards when it becomes level with the emitter on the Z-Axis
  10. I'm trying to figure out if there's a script function to test if an avatar has building/rezzing permissions. I would like the script I'm working on to act accordingly, instead of attempting to rez objects and shouting errors when it can't
  11. And to make sure face 2 is indeed the one you want to apply the texture to // This is the essential script to drop in a prim when you need to ascertain the number of a face (or faces)// Touch the prim surfaces to learn their face numbers, which you can then use in other scripts for texturing, colouring etc. say(string message){ llSay(PUBLIC_CHANNEL, message);} default{ touch_start(integer num_detected) { integer face = llDetectedTouchFace(0); if (face == TOUCH_INVALID_FACE)// { say("The touched face could not be determined");//if using a viewer that doesn't support detecting face touches// } else// { say("You touched face number " + (string) face);// } }}
  12. Right, in addition to what Rolig said, if you're trying to set the texture to the link the script resides in, you could change the 3 to LINK_THIS. If you're not sure which link number the prim is, you can use this script below. default{// Drop this script into the root prim of of a build// Touch any prim to learn its link number touch_start(integer num_detected) { llOwnerSay("Link number clicked: " + (string)llDetectedLinkNumber(0) ); }}
  13. If it is set to "Owner", all others can only turn the system on and off via dialog "Group", group members with active tags can access same menu as owner, all others get On/off menu
  14. I have it starting out as "Public". It is changed via dialog menu. It will only be able to be, Public, Owner, or Group. Only group or owner are allowed to change it, though I do need to figure out some more logic to make it so that group members can change settings, but not security part, guess I could leave the security part for only the owner?
  15. Thanks, yeah I had it kind of messy, re-wrote it, not too far off from your solution lol. Guess that's what I was going for before, but jumbled up with too many tests.
  16. No, I understood it very well. Just trying to get my brain back into scripting again, as it's been a while. I did modify the touch event some more, as I was still having trouble getting it to give a dialog in some security instances. I guess I had it a little jumbled with the different tests, so I re-wrote it testing for each security setting, then against the llDetectedKey or llDetectedGroup touch_start(integer num) { llResetTime();//because part of the script triggers a timer, and within that timer I will remove the listen if more than 20 seconds has passed without activity llListenRemove(listener); key toucher = llDetectedKey(0); chan = (integer)llFrand(-100000)-1000; listener = llListen(chan,"",toucher,""); active = TRUE; templist = main;//resets main menu list and text in case toucher is not an admin tempsectext1 = ""; if(security == "Public") { if(toucher == llGetOwner() || llDetectedGroup(0)) { templist += sec;//adds admin only buttons and text tempsectext1 = sectext1 + security +"\n"; maindialog(toucher); } else{maindialog(toucher);} } else if (security == "Owner") { if(toucher == llGetOwner()) { templist += sec; tempsectext1 = sectext1 + security +"\n"; maindialog(toucher); } else { llDialog(toucher, "Click button to turn " + onoff +".",[onoff, "Exit"],chan); } } else if(security == "Group") { if((toucher == llGetOwner())|| llDetectedGroup(0)) { templist += sec; tempsectext1 = sectext1 + security +"\n"; maindialog(toucher); } else { llDialog(toucher, grouptext + "Click button to turn " + onoff +".",[onoff, "Exit"],chan); } } }
  17. Nope, still not quite right, which is odd. I have it start out in "Public" mode, if I switch it from that to something else, it works correctly with my alt, but if I switch it back to "Public", no dialog comes up for my alt, not even the limited menu that's supposed to come up for non-group/owner. The reason I want it to check for owner/group member in public mode is because there are additional buttons that I don't want shown in the public dialog
  18. oops, nevermind, didn't notice the (verticle bar?, what is that symbol called?) was double in your version, will try that and hope it works touch_start(integer num) { llResetTime(); llListenRemove(listener); key toucher = llDetectedKey(0); chan = (integer)llFrand(-100000)-1000; listener = llListen(chan,"",toucher,""); active = TRUE; templist = main; tempsectext1 = ""; if((security == "Public") && (toucher != llGetOwner()) && (llDetectedGroup(0) == FALSE)) { maindialog(toucher); } else if((security == "Owner" && toucher != llGetOwner())( security == "Group" && llDetectedGroup(0) == FALSE)) { string grouptext = ""; if(security == "Group" && llDetectedGroup(0) == FALSE) { grouptext = "If you are a group member, you must have the group tag active"; } llDialog(toucher, grouptext + "Click button to turn " + onoff +".",[onoff, "Exit"],chan); } else if((toucher == llGetOwner()) (llDetectedGroup(0) == TRUE && security == "Group")) { templist += sec; tempsectext1 = sectext1 + security; tempsectext1 +="\n"; maindialog(toucher); } }
  19. Hmm, so I logged in with my alt to test it, and it seems I'm still having trouble with the logic, not sure why. Even on my main avatar, if I set it to group, and have a different group active than the object, it gives me the non-owner dialog, but the touch event is supposed to always allow the owner the main dialog, no matter the group. touch_start(integer num) { llResetTime(); llListenRemove(listener); key toucher = llDetectedKey(0); chan = (integer)llFrand(-100000)-1000; listener = llListen(chan,"",toucher,""); active = TRUE; templist = main; tempsectext1 = ""; if((security == "Public") && (toucher != llGetOwner()) && (llDetectedGroup(0) == FALSE)) { maindialog(toucher); } else if((security == "Owner" && toucher != llGetOwner())|( security == "Group" && llDetectedGroup(0) == FALSE)) { string grouptext = ""; if(security == "Group" && llDetectedGroup(0) == FALSE) { grouptext = "If you are a group member, you must have the group tag active"; } llDialog(toucher, grouptext + "Click button to turn " + onoff +".",[onoff, "Exit"],chan); } else if((toucher == llGetOwner())| (llDetectedGroup(0) == TRUE && security == "Group")) { templist += sec; tempsectext1 = sectext1 + security; tempsectext1 +="\n"; maindialog(toucher); } }
  20. Thank you Rolig! Yes, I have a listener already opened in the state_entry. It was the parenthesis that I was missing. Now I just need someone to help me test the group/public touches.
  21. I have this script I'm working on, and trying to add security features, so that the owner/group members can set the security. Anyways, I can't figure out why it's not giving me a dialog when I click it. Here is the touch event (Don't want to post the whole script as it's something I plan to sell probably). Maybe I have the logic wrong somewhere? I've been looking at it and working on it for hours, and need a second+ set of eyes to look at it for me. touch_start(integer num) { key toucher = llDetectedKey(0); templist = main; tempsectext = ""; if(security == "Public" && toucher != llGetOwner() && llDetectedGroup(0) == FALSE) { maindialog(toucher); } else if(security == "Owner" && toucher != llGetOwner()| security == "Group" && llDetectedGroup(0) == FALSE) { string grouptext = ""; if(security == "Group" && llDetectedGroup(0) == FALSE) { grouptext = "If you are a group member, you must have the group tag active for " + groupName + "\n\n"; } llDialog(toucher, grouptext + "Click button to turn " + onoff +".",[onoff, "Exit"],chan); } else if(toucher == llGetOwner() | llDetectedGroup(0) == TRUE && security == "Group") { templist += sec; tempsectext = sectext; maindialog(toucher); } }
  22. Thanks! I'm not worried too much about an exact facing, I just don't want the particles coming out and moving in too much of a curve, or back through my avatar, if my avatar is facing to much away from the target (whether it be an object or an avatar). I didn't know about the llCastRay function though, and can see where it might be usefull for some other ideas that I have.
  23. Thanks! I think this might be what I'm looking for, a "close enough" rotation, not an exact facing like one of the other suggestions. I will give it a try.
  24. Hello! Old SL user, but was away for a long time! I hadn't used SL since around the time that shadows were made more dynamic, and came back to many wonderful changes! I'm working on a script for wands, and for the particle effect to look right for some spells, the avatar needs to be facing its target. I'm sure there's some way of doing that by checking the rotation of the avatar to the relativity of the target, but I don't know the logic to make that happen. Of course I'm sure that wouldn't work if the avatar is sitting, say on a pose ball, and then of course animations cause a whole different problem with that. My goal in developing the wand, is to also create an animation, possibly for each spell. Animations aside, assuming the pose balls used are for dueling, in which case, I would assume would be facing each other, I would also want the script to check if the avatar is sitting, and if not, it would check to make sure it is facing the target. Sorry to ramble, I've been up all day and had too much coffee.
×
×
  • Create New...