Jump to content

Bezahlen mit Menue, Geld geht aber an falsche Person :(


Triexy
 Share

You are about to reply to a thread that has been inactive for 2911 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hi Leute,

habe inzwischen raus gefunden woran es liegt, das dass Geld vom Besitzer abgezogen wird und dem anderen Avatar gut geschrieben wird. Es liegt an llGiveMoney aber ich weiss nicht was ich fuer einen Befehl stattdessen in einer Abfrage verwenden kann. Hoffe mir kann wer helfen...

 

integer price1 = 100; 
integer price2 = 120; 
integer price3 = 140; 
integer price4 = 160; 

list buttons = ["1 Woche", "2 Wochen", "3 Wochen", "4 Wochen"];
string dialogInfo = "\nPlease make a choice.";

key ToucherID;
integer dialogChannel;
integer listenHandle;
 
default
{
on_rez(integer start_param)
{

llSetPayPrice(PAY_HIDE, [PAY_HIDE ,PAY_HIDE, PAY_HIDE, PAY_HIDE]);
llSetPayPrice(PAY_HIDE, [150,PAY_HIDE,PAY_HIDE,PAY_HIDE]);
llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
key id = llDetectedKey(0);
}
run_time_permissions(integer perm)
{
if(perm & PERMISSION_DEBIT)
state cash;
}
}

state cash
{
 
    state_entry()
    {

        dialogChannel = -1 - (integer)("0x" + llGetSubString( (string)llGetKey(), -7, -1) );
    }
 
    touch_start(integer num_detected)
    {
        ToucherID = llDetectedKey(0);
 
        llDialog(ToucherID, dialogInfo, buttons, dialogChannel);
        listenHandle = llListen(dialogChannel, "", ToucherID, "");
    }
 
    //HERE'S OUR NEWLY ADDED LISTEN EVENT
    listen(integer channel, string name, key id, string message)
    {
   
 
        // Turn off the listener at a convenient common junction. You can usually avoid coding this multiple times.
        llListenRemove(listenHandle);   
 
        if (message == "1 Woche")
        {
           llSay(0,"blbalba." );
           llGiveMoney(id, price1);
          // Startet Script test
          
llSetScriptState("woche_01",TRUE);
        }
        else if (message == "2 Wochen")
               
        {
            integer gCountdown = 40;
            llSay(0,"blabla" ); 
         llGiveMoney(id, price2);
        llSetScriptState("woche_02",TRUE);     
         }   
        else if (message == "3 Wochen")

        {
            llSay(0,"Blabla" );  ;
            llSetScriptState("woche_03",TRUE); 
    }
    
 else
        {
             llSetScriptState("woche_04",TRUE);
              llGiveMoney(id, price4);
llSay(0,"blablba." );
        }
    }

}

 

Link to comment
Share on other sites

Klar. Um das Geld zu behalten, braucht man llGiveMoney () auch nicht. Das nutzt man nur, wenn man andere Bezahlen will, wie bei einen Split Tipjar.  1. Wieviel Scripting Erfahrung hast Du schon und 2. Was willst Du erreichen 3. brauchst du noch hilfe oder hat sich das jetzt erledigt?

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2911 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...