Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Trouble with GUI (https://forums.graalonline.com/forums/showthread.php?t=134267529)

InfamousPride 12-08-2012 03:54 PM

Trouble with GUI
 
I am trying to make this GUI appear on login (like it was before I changed a few things) but it stopped. What's missing/incorrect.

NPC Code:
//#CLIENTSIDE
function onActionPlayerOnline() {
new GuiWindowCtrl("OnLogin") {
profile = GuiBlueWindowProfile;
x = 150;
y = 150;
height = 412;
width = 187;
text = "Graal Apocalypse";

closequery = true;
canminimize = true;
canmaxamize = true;
}
}



I have already put it in NPC Control.

cbk1994 12-08-2012 05:50 PM

Your GUI code should go in a weapon which is added to players on login. onActionPlayerOnline is only called in the Control-NPC, and only serverside.

In Control-NPC
PHP Code:

function onActionPlayerOnline() {
  
// eventually you'll want to set up an array or so here of weapons and
  // loop through them rather than adding another addWeapon line per weapon
  // since most servers tend to add a dozen or more weapons on login
  
player.addWeapon("LoginGUI");


In weapon LoginGUI:
PHP Code:

//#CLIENTSIDE
function onCreated() {
  new 
GuiWindowCtrl(...) {
    
// etc
  
}



InfamousPride 12-08-2012 06:01 PM

I originally was using function onCreated() but was told it was incorrect use for this >.<

Thanks for the help :)

+rep when I get the chance.

Crow 12-08-2012 11:19 PM

Quote:

Originally Posted by InfamousPride (Post 1708986)
I originally was using function onCreated() but was told it was incorrect use for this >.<

You either misunderstood, or whoever told you did not know what they were talking about.


All times are GMT +2. The time now is 09:06 PM.

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