Thread: Reset GUI
View Single Post
  #9  
Old 08-18-2008, 08:09 PM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Quote:
Originally Posted by TheStan View Post
PHP Code:
//Scripted by Switch
function onActionServerSide() {
  if (
params[0] == "reset") {
    
temp.text = (params[1] == null)? (player.account " has been reset.") : (player.account " has been reset because: " params[1]);
    
sendToRC("/reset " @player.account);
    
savelog2("reset.txt"temp.text);
  }
}

//#CLIENTSIDE
function onCreated() {
  
this.beg = { "iA""Pq""oa""cQ""Vu""zC""Gd""jE",
    
"aT""fg""io""mv" };
  
this.mid = { 123456789};
  
this.end = { "io""vb""cH""pA""oA""nb""ua""Ac",
    
"iA""Co""Op""In" };
  
this.confCode null;
}

function 
onPlayerChats() {
  if (
player.chat == "/reset") {
    
this.confCode randomString(this.beg) @ randomString(this.mid) @ randomString(this.end);
          
    new 
GuiWindowCtrl("Reset_Window") {
      
profile GuiBlueWindowProfile;
      
canClose true;
      
canMaximize false;
      
canMinimize false;
      
canResize false;
      
canMove true;
      
closeQuery false;
      
destroyOnHide true;
      
text "Reset Window";
      
250;
      
250;
      
width 350;
      
height 250;
      
      new 
GuiMLTextCtrl("Reset_Info") {
        
profile GuiBlueMLTextProfile;
        
25;
        
25;
        
width 300;
        
text "<center>If you really wish to be reset, fill in the text box below with the confirmation code in the left text box and click the 'Reset Me!' button. You can also fill out a reason as to why you're reseting if you want to in the right text box.
If not, just close this window.

<b><u>CONFIRMATION CODE:</u></b>
@thiso.confCode"</center>";
      }
      
      new 
GuiTextEditCtrl("Reset_ConfCodeEnter") {
        
profile GuiBlueTextEditProfile;
        
25;
        
170;
        
width 70;
        
height 20;
      }
      
      new 
GuiTextEditCtrl("Reset_Reason") {
        
profile GuiBlueTextEditProfile;
        
100;
        
170;
        
width 220;
        
height 20;
      }
      
      new 
GuiButtonCtrl("Reset_Button") {
        
profile GuiBlueButtonProfile;
        
100;
        
200;
        
width 150;
        
height 40;
        
text "Reset Me!";
      }
    }
  }
}

function 
Reset_Button.onAction() {
  if (
Reset_ConfCodeEnter.text == this.confCode) {
    
triggerserver("gui",name,"reset",Reset_Reason.text);
  }
  else {
    
Reset_Button.text "Wrong Confirmation Code!";
    
sleep(3);
    
Reset_Button.text "Reset Me!";
  }

Bit bored so I trimmed a lil bit off just for the hell of it. It wasn't necessary for you to have both of those "reset#" arguments when you could have had just a condition.
Ah that's true, but I just wasn't thinking about that xD
Anyway, it's still just about the exact same thing...
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote