|
Owain Raymaker
Registered User
Join date: 1 Apr 2007
Posts: 21
|
02-18-2009 12:53
Hi all My request for help is regarding a vendor/staff bonus script I am working on, that: - works as a vendor for a product - then; - asks a customer (via a dialog) to select a sales assistant that has been helping a customer, once they have received their items - then; - this triggers off a percentage payment to the selected staff member. What I can't seem to do is to trigger this 'dialog' script immediately a customer has purchased an item. I have a vendor script that works fine, but when I try to combine the two 'functions', the payment window appears, the customer gets their items BUT the dialog menu fails to be displayed. All suggestions will be greatly received  Cheers Owain Raymaker
|
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
02-18-2009 13:20
It would be easier to tell if you showed us what your script looks like already. 
|
|
Lazink Maeterlinck
Registered User
Join date: 8 Nov 2005
Posts: 332
|
02-18-2009 14:09
It kind of depends on how you want to do it.. give the item to someone then ask, or don't give the item to someone until they answer the question of who was helpful. Either way, your going to want an llDialog in the money event. please note this is semi pseudo code:
money(key id, integer amount) { if(amount == Price of item) { llGiveInventoryItem(id, item_payed_for); llSetTimerEvent(60); //give them 60 seconds to say who Listener = llListen(channel_to_listen_on, "", id, ""); llDialog(id, "Who helped you the most?", Staff_list, channel_to_listen_on); } }
listen(integer channel, string name, key id, string message) { integer index = llListFindList(Staff_list, [message]); if(index != -1) { llGiveMoney(llList2Key(Staff_list_keys, index), (integer) amount * share_percent); } else llSay(0, "The person you selected is not a staff member"); //Error llListenRemove(Listener); }
timer() { llSetTimerEvent(0); llListenRemove(Listener); }
That is a really really simple, not very robust way to do it, if you give the item first then ask. I'm assuming you are writing this yourself, so hopefully you'll be able to read that and pick out what you need 
|