Money/pl

From Second Life Wiki
< Money
Revision as of 10:37, 18 March 2008 by WoodPaker Barbosa (talk | contribs) (New page: {{LSL_Function/warning|Security|Zawsze (''ZAWSZE!'') sprawdzaj wysokość oplaty.}}{{LSL_Event |event_id=20 |event_delay |event=money |p1_type=key|p1_name=id|p1_desc=who paid |p2_type=inte...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Emblem-important-red.png Security Warning!

Zawsze (ZAWSZE!) sprawdzaj wysokość oplaty.

Description

Event: money( key id, integer amount ){ ; }

Wywolywane gdy id wplaca pieniadze do prima w wysokosci amount.

• key id who paid
• integer amount the amount paid

Specification

Kiedy L$ sa wlacana do prima, wtedy przekazywane sa wlascicielowi.
Jesli pieniadze sa wplacane do prima, ktorego wlascicielem jest grupa sa natychmiast rowno dzielone miedzy czlonkow grupy (To wlasnie dlatego grupa nie moze grantowacPERMISSION_DEBIT).<br.> Nie zapomnij ustawic w obiekcie funkcji pay.
Przycisk PAY powinien byc skonfigurowany w wiekszosci aplikacji gdzie pieniadze sa przekazywane (llSetPayPrice), to bardzo ulatwia wplate do obiektu.

Caveats


Examples

<lsl>integer price = 10;

default {

   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()
   {
       llSetPayPrice(price, [price ,PAY_HIDE, PAY_HIDE, PAY_HIDE]);
   }
   money(key id, integer amount)
   {
       if(amount != price)
       {
           llGiveMoney(id, amount);
           llInstantMessage(id, "You paid "+(string)amount+", which is the wrong price, the price is: "+(string)price);
       }
       else
       {
           llInstantMessage(id, "You paid the right price");
       }
   }

}</lsl>

See Also

Functions

•  llGiveMoney Przekaz pieniadze nastepnemu avatarowi
•  llSetPayPrice Skonfiguruj przycisk pay

Deep Notes

Signature

event void money( key id, integer amount );