Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:40 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.