Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-26-2011, 09:12 AM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Chat System

This is just a really basic (bare bones) of a chat system.
I decided to post it here seeming as I have no use for it.
I originally scripted it just for fun.

PHP Code:
function onActionServerSide() {
  if (
params[0] == "add") {
    for (
temp.plallplayers) {
      
pl.triggerclient("weapon"this.name"add"player.nickparams[1]);
    }
  }
}
//#CLIENTSIDE
function onCreated() {
  new 
GuiWindowCtrl("Chat_Window") {
    
profile GuiBlueWindowProfile;
    
clientrelative true;
    
clientextent "320,240";
    
canclose false;
    
canmaximize false;
    
canminimize false;
    
canmove false;
    
canresize false;
    
closequery false;
    
destroyonhide false;
    
text "Chat";
    
screenwidth width 2;
    
screenheight height 2;
    new 
GuiScrollCtrl("Chat_MultiLine_Scroll") {
      
profile GuiBlueScrollProfile;
      
height 221;
      
hscrollbar "dynamic";
      
vscrollbar "dynamic";
      
width 320;
      new 
GuiMLTextCtrl("Chat_MultiLine") {
        
profile GuiBlueMLTextProfile;
        
height 17;
        
horizsizing "width";
        
text "Welcome to the Chat system, Please be nice!";
        
width 295;
      }
    }
    new 
GuiTextEditCtrl("Chat_Bar") {
      
profile GuiBlueTextEditProfile;
      
height 20;
      
width 320;
      
220;
    }
  }
  
Chat_Window.destroy();
}

function 
Chat_Bar.onAction() {
  
triggerserver("weapon"this.name"add"Chat_Bar.text);
  
Chat_Bar.text "";
}

function 
onActionClientSide() {
  if (
params[0] == "add") {
    
Chat_MultiLine.addtext("<br>"@params[1]@": "@params[2], false);
    
Chat_MultiLine.scrolltobottom();
  }

Also if you have any suggestions to improve it feel free to let the idea's flow freely.
__________________

Gund for president.

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

Last edited by Gunderak; 11-26-2011 at 01:16 PM..
Reply With Quote
 


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 12:17 AM.


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