|
Katryna Jie
Registered User
Join date: 24 Jun 2007
Posts: 187
|
10-11-2007 18:01
HELP! We have recenlty set up a vendor, which works fine and all... but want to restrict it to only sell to members of a particular group. I scoured the LSL-Portal but have either overlooked it or there's nothing there...
What can I add to the script, to make it check if the buyer is a member of a particular group (without the group having to be active)??
Thanks! *hugs*
|
|
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
|
10-11-2007 18:16
To my knowledge, the only group you can know about is the active one. So you either have to stipulate that they have that group set as active, or you cannot restrict this way. Sorry.
|
|
Katryna Jie
Registered User
Join date: 24 Jun 2007
Posts: 187
|
10-11-2007 19:11
Thanks for the reply.. so I guess the question changes to just "How can I make a vendor check/sell only to a specific group?"
|
|
Ilobmirt Tenk
Registered User
Join date: 4 Jun 2007
Posts: 135
|
10-11-2007 20:25
you might want to look at llDetectedGroup
Caveats to using this are that it only works in the touch event. Therefore, using the Sl object editor, have touching the object make the pay dialog popup. Use a global variable which is tied to the result of llDetectedGroup. If TRUE and the cash = item price, give them the object for sale, otherwise, you could be nice and refund their cash.
|
|
Ilobmirt Tenk
Registered User
Join date: 4 Jun 2007
Posts: 135
|
10-11-2007 20:32
Even better. Use llSameGroup with the key of the person triggering the money event. No caveats compared to llDetected group. Example: default { money(key giver, integer amount) {
if(llSameGroup(giver) == TRUE){ llSay(0,"Youre within my group! ^_^"); } else{ llSay(0,"I don't need your stinkin money... but then again... I'm damn greedy >:D"); } } }
|
|
Katryna Jie
Registered User
Join date: 24 Jun 2007
Posts: 187
|
10-11-2007 21:32
Thankies ^_^ *big hug* I'll give it a try tonight and see if it works. Wish me luck ^_^
|
|
Squirrel Wood
Nuteater. Beware!
Join date: 14 Jun 2006
Posts: 471
|
10-11-2007 23:27
llSameGroup() requires the buyer to be in the same group as the vendor AND the group has to be the active one though.
|