View Single Post
  #6  
Old 04-30-2007, 03:15 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
PHP Code:

//#CLIENTSIDE
function onCreated(){
passwin.destroy();
}
function 
onWeaponFired(){
new 
GuiWindowCtrl("passwin") {
  
profile GuiBlueWindowProfile;
  
10;
  
10;
  
canclose=true;
  
canmove=true;
  
canminimize=false;
  
canmaximize=false;
  
canresize=false;
  
destroyonhide=true;
  
width 160;
  
height 120;
  
text "";
  
  new 
GuiMLTextCtrl("passs") {
  
profile GuiBlueMLTextProfile;
  
10;
  
30;
  
width 140;
  
height 10;
  
text "<center>Password:</center>";
}
  
  new 
GuiTextEditCtrl("password12") {
  
profile GuiBlueTextEditProfile;
  
10;
  
50;
  
width 140;
  
height 20;
  
text "";
}

 new 
GuiButtonCtrl("button1") {
   
profile GuiBlueButtonProfile;
   
30;
   
80;
   
width 100;
   
height 20;
   
text "Submit";
 }
  
}
}

function 
button1.onAction(){
if (
password12.text == "password"){
player.chat "!";
}

That should work, but heres another way you can "catch" the onAction

PHP Code:

//#CLIENTSIDE
function onCreated(){
passwin.destroy();
}
function 
onWeaponFired(){
new 
GuiWindowCtrl("passwin") {
  
profile GuiBlueWindowProfile;
  
10;
  
10;
  
canclose=true;
  
canmove=true;
  
canminimize=false;
  
canmaximize=false;
  
canresize=false;
  
destroyonhide=true;
  
width 160;
  
height 120;
  
text "";
  
  new 
GuiMLTextCtrl("passs") {
  
profile GuiBlueMLTextProfile;
  
10;
  
30;
  
width 140;
  
height 10;
  
text "<center>Password:</center>";
}
  
  new 
GuiTextEditCtrl("password12") {
  
profile GuiBlueTextEditProfile;
  
10;
  
50;
  
width 140;
  
height 20;
  
text "";
}

 new 
GuiButtonCtrl("button1") {
   
profile GuiBlueButtonProfile;
   
30;
   
80;
   
width 100;
   
height 20;
   
text "Submit";
   
thiso.catchevent(this"onAction""CheckPassword");
 }
  
}
}

function 
CheckPassword()
{
  if (
password12.text == "password")
    
player.chat "!";

Reply With Quote