View Single Post
  #1  
Old 12-09-2011, 03:29 PM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Alert(); In Graal!

Anyway I have made my own "Alert" function.
If you would like to see it here's how.

Step 1:
Make a new class and name it "alert".
Now place this code in the newly created class.
PHP Code:
//#CLIENTSIDE
function Alert(titlemessage) {
  new 
GuiWindowCtrl("Alert_Window") {
    
profile GuiBlueWindowProfile;
    
destroyonhide 1;
    
canmaximize false;
    
canminimize false;
    
canclose false;
    
canmove false;
    
isexternal 0;
    
width 320;
    
height 120;
    
text title;
    
screenwidth width 2;
    
screenheight height 2;
    new 
GuiScrollCtrl("Alert_Text_Container") {
      
profile GuiBlueScrollProfile;
      
6;
      
24;
      
width 308;
      
height 69;
      
hScrollBar "dynamic";
      
vScrollBar "dynamic";
      new 
GuiMLTextCtrl("Alert_Text") {
        
profile GuiBlueMLTextProfile;
        
text message;
        
width 287;
      }
    }
    new 
GuiButtonCtrl("Alert_Ok_Button") {
      
profile GuiBlueButtonProfile;
      
width 40;
      
height 20;
      
Alert_Window.width Alert_Ok_Button.width 7;
      
Alert_Window.height Alert_Ok_Button.height 7;
      
text "Ok";
    }
  }
}

function 
Alert_Ok_Button.onAction() {
  
Alert_Window.destroy();

Step 2:
This is how to use it.
On any script place this directly under onCreated on the clientside.
PHP Code:
this.join("alert"); 
Then to alert the player place this.
PHP Code:
Alert("Alert!""Hello world!"); 
It works like this:
Alert("TITLE", "MESSAGE");

-Enjoy
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote