Thread: GUI Issue
View Single Post
  #13  
Old 09-28-2007, 02:34 PM
Mark Sir Link Mark Sir Link is offline
Kevin Azite
Mark Sir Link's Avatar
Join Date: Sep 2005
Posts: 1,489
Mark Sir Link is just really niceMark Sir Link is just really nice
Send a message via AIM to Mark Sir Link
Class script:
PHP Code:
function onCreated()
{
setimg("classic_warpicon_gcstudios.png");
this.attr[0] = this.text;
}

function 
onActionRemoveFlier()
  {
  
destroy();
}

//#CLIENTSIDE
function onPlayerTouchsMe()
{
player.chat this.attr[0];
FlierWindow = new GuiWindowCtrl("Flier_" this.number);
  
with (FlierWindow)
  {
    
profile "GuiBlueWindowProfile";
    
this.posx screenwidth/-150 ;
    
this.posy screenheight/150;
    
position = {this.posxthis.posy};
    
extent "300 300";
    
canMove true;
    
canResize false;
    
canClose true;
    
tile true;
    
canmaximize false;
    
text "Flier by " thiso.owner.account;
    
destroyonhide true;
    
    new 
GuiScrollCtrl("Test_ScrollField") {
  
profile GuiBlueScrollProfile;
  
position "5 23";
  
extent "290 270";
  
hScrollBar "dynamic";
  
vScrollBar "alwaysOn";
  
  new 
GuiMLTextCtrl("Test_MultiLineText") {
  
profile "GuiBlueMLTextProfile";
  
position "5 0";
  
extent "250 250";
  
text format("<font size = 16> %s lolol</font>"thiso.attr[0]);
}

}
  }
  
GraalControl.addControl(FlierWindow);

NPC Script (Kinda Messy because of checks I was doing, etc)
PHP Code:
//Coded by Kevin Azite
//Under Progress

function onActionServerside()
  {
  if(
params[0] == "place")
    {
    
temp.npc putnpc2(params[1], params[2], "join fliers;");
    
temp.npc.text params[3];
    
temp.npc.owner player;
  }
}
//#CLIENTSIDE
function onPlayerChats()
  {
  if(
player.chat.starts("/flier"))
  {
  
this.text player.chat.substring(6);
  
player.chat this.text;
  
  if(
player.dir == 0)
  {
  if(
onwall(player.x+.5player.1.5))
  {
  
triggeraction(00"serverside""Fliers""place"player.x+.5player.y-1this.text);
}
}
}
}
function 
onMouseDown(button)
  {
  if(
button "right")
    {
    
triggeraction(mousexmousey"RemoveFlier"null);
  }
  } 
Reply With Quote