Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Basic question

Jade Bard
Registered User
Join date: 7 Jul 2004
Posts: 106
07-13-2004 13:11
How do I get the name of a person who put money into my machine. Such as "Jade Bard"
Loki Pico
Registered User
Join date: 20 Jun 2003
Posts: 1,938
07-13-2004 13:25
At the top of the UI is A WORLD menu. Use that to see "my account". You can look at the details and see who has paid you.

Doh, I just noticed this is the scripting forum, probably not what you meant.
_____________________
Jade Bard
Registered User
Join date: 7 Jul 2004
Posts: 106
07-13-2004 13:27
Yeah in my script. I want to know the name of the person who put money in the pot.
Cray Levy
Member
Join date: 7 Jul 2004
Posts: 33
07-13-2004 13:53
lookit here
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
07-13-2004 14:00
You can do two things:
A. Use llKey2Name.
B. Use llRequestAgentData.

The latter takes a bit of thought to implement, and the former is not guarenteed to work if the object that the money is given to is close to a sim border.

llKey2Name is simple:
CODE

money(key giver, integer amount) {
llSay(0, "Thanks for giving me money " + llKey2Name(giver));
}


llRequestAgentData is... well... not:

CODE

key moneyGiverKey = NULL_KEY;
string moneyGiverName = "";
integer moneyPaid = 0;

key curRequest = NULL_KEY
default {
money(key giver, integer amount) {
// Find the name of the giver:
curRequest = llRequestAgentData(giver, DATA_NAME);
}
dataserver(key req, string data) {
if (req == curRequest) {
moneyGiverName = data;
state ready;
}
}
}

state ready {
state_entry() {
llSay(0, "Thanks for giving me money " + moneyGiverName);
}
}

==Chris
Jade Bard
Registered User
Join date: 7 Jul 2004
Posts: 106
07-13-2004 15:31
Thank you very much