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;
  
x = 10;
  
y = 10;
  
canclose=true;
  
canmove=true;
  
canminimize=false;
  
canmaximize=false;
  
canresize=false;
  
destroyonhide=true;
  
width = 160;
  
height = 120;
  
text = "";
  
  new 
GuiMLTextCtrl("passs") {
  
profile = GuiBlueMLTextProfile;
  
x = 10;
  
y = 30;
  
width = 140;
  
height = 10;
  
text = "<center>Password:</center>";
}
  
  new 
GuiTextEditCtrl("password12") {
  
profile = GuiBlueTextEditProfile;
  
x = 10;
  
y = 50;
  
width = 140;
  
height = 20;
  
text = "";
}

 new 
GuiButtonCtrl("button1") {
   
profile = GuiBlueButtonProfile;
   
x = 30;
   
y = 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;
  
x = 10;
  
y = 10;
  
canclose=true;
  
canmove=true;
  
canminimize=false;
  
canmaximize=false;
  
canresize=false;
  
destroyonhide=true;
  
width = 160;
  
height = 120;
  
text = "";
  
  new 
GuiMLTextCtrl("passs") {
  
profile = GuiBlueMLTextProfile;
  
x = 10;
  
y = 30;
  
width = 140;
  
height = 10;
  
text = "<center>Password:</center>";
}
  
  new 
GuiTextEditCtrl("password12") {
  
profile = GuiBlueTextEditProfile;
  
x = 10;
  
y = 50;
  
width = 140;
  
height = 20;
  
text = "";
}

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

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