Difference between revisions of "User:Ugleh Ulrik/GiveBulkMoney"

From Second Life Wiki
Jump to navigation Jump to search
(Created page with 'GiveBulkMoney function will send money to all the uuid's inside of a list. '''Function''' <lsl> GiveBulkMoney(list u, integer amount){ integer a = 0; while(a < llGetListLength(u...')
 
m (<lsl> tag to <source>)
 
(3 intermediate revisions by one other user not shown)
Line 2: Line 2:


'''Function'''
'''Function'''
<lsl>
<source lang="lsl2">
GiveBulkMoney(list u, integer amount){
GiveBulkMoney(list u, integer amount){
integer a = 0;
integer a = 0;
Line 10: Line 10:
     ++a;
     ++a;
}
}
}</lsl>
}</source>


'''Example'''
'''Example'''
Make sure you change the uuid's in the list, i don't want your money accidentally :)
<source lang="lsl2">
<lsl>
GiveBulkMoney(list u, integer am){
GiveBulkMoney(list u, integer am){
integer a = 0;
integer a = 0;
Line 34: Line 33:
     touch_start(integer total_number)
     touch_start(integer total_number)
     {
     {
list users = ["fafe960b-a98f-4a65-9168-a94b55f4a8dd", "fafe960b-a98f-4a65-9168-a94b55f4a8dd"];
list users = ["00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000"];
         GiveBulkMoney(users,2);
         GiveBulkMoney(users,2);
     }
     }
}
}


</lsl>
</source>
{{LSLC|User-Defined Functions}}

Latest revision as of 14:45, 22 January 2015

GiveBulkMoney function will send money to all the uuid's inside of a list.

Function

GiveBulkMoney(list u, integer amount){
integer a = 0;
while(a < llGetListLength(u))
{
    llGiveMoney(llList2Key(u,a), amount);
    ++a;
}
}

Example

GiveBulkMoney(list u, integer am){
integer a = 0;
while(a < llGetListLength(u))
{
    llGiveMoney(llList2Key(u,a), am);
    ++a;
}
}

default
{
    state_entry()
    {
         llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
         
    }

    touch_start(integer total_number)
    {
list users = ["00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000"];
        GiveBulkMoney(users,2);
    }
}