Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   report system problem (https://forums.graalonline.com/forums/showthread.php?t=134266827)

Fatel 07-21-2012 01:23 AM

report system problem
 
1 Attachment(s)
not sure how to make whats in the text boxes display in rc.
PHP Code:

//#CLIENTSIDE
function onCreated() {
  new 
GuiWindowCtrl("Report_Window1") {
    
profile GuiBlueWindowProfile;
    
clientrelative true;
    
clientextent "333,141";

    
canmove true;
    
canresize true;
    
closequery false;
    
destroyonhide false;
    
firstresponder "Editor_Button1";
    
text "Worlds Connected Report Manager,by Fatel";
    
318;
    
67;

    new 
GuiTextEditCtrl("Report_TextEdit1") {
      
profile GuiBlueTextEditProfile;
      
height 20;
      
width 171;
      
89;
      
71;
    }
    new 
GuiTextEditCtrl("Report_TextEdit2") {
      
profile GuiBlueTextEditProfile;
      
height 20;
      
width 80;
      
125;
      
29;
    }
    new 
GuiButtonCtrl("Report_Button1") {
      
profile GuiBlueButtonProfile;
      
text "Report!";
      
width 80;
      
129;
      
100;
    }
    new 
GuiTextCtrl("Report_Text1") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Player name:";
      
width 73;
      
48;
      
28;
    }
    new 
GuiTextCtrl("Report_Text2") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Reason:";
      
width 48;
      
39;
      
71;
    }
  }
}

function 
Report_Button1.onAction() {
  
// Button "Report!" has been pressed
 



cbk1994 07-21-2012 01:38 AM

When the button is clicked, trigger serverside with the data from those text fields and use either the echo(message) or sendToRC(message) command to output to RC.

You can read more about serverside, clientside, and triggers here.

You can find a simple example of responding to clicks on GUI buttons here.

Fatel 07-21-2012 02:22 AM

Quote:

Originally Posted by cbk1994 (Post 1699866)
When the button is clicked, trigger serverside with the data from those text fields and use either the echo(message) or sendToRC(message) command to output to RC.

You can read more about serverside, clientside, and triggers here.

You can find a simple example of responding to clicks on GUI buttons here.

i know about triggers corresponding with buttons in a GUI, i want it to send the info in the text boxes to rc, im not sure how to make the text send to rc when i press "Report!"

BlueMelon 07-21-2012 02:40 AM

PHP Code:


function onActionServerSide(cmd,player_name,report_reason){
  if(
cmd == "report"){
    echo(
"REPORT: Player name: "@player_name@" Reason: "@report_reason@" from: "@player.account);
  }
}


//#CLIENTSIDE

// ... GUI Code

function Report_Button1.onAction(){
  
temp.player_name Report_Text1.text;
  
temp.reason Report_Text2.text;
  
triggerserver("gui",this.name,"report",temp.player_name,temp.reason);


Here is a quick example on how to trigger serverside to echo.
I suggest you follow proper naming conventions when naming your GUI controls.
http://forums.graalonline.com/forums...ad.php?t=85600

Fatel 07-21-2012 03:00 AM

Quote:

Originally Posted by BlueMelon (Post 1699868)
PHP Code:


function onActionServerSide(cmd,player_name,report_reason){
  if(
cmd == "report"){
    echo(
"REPORT: Player name: "@player_name@" Reason: "@report_reason@" from: "@player.account);
  }
}


//#CLIENTSIDE

// ... GUI Code

function Report_Button1.onAction(){
  
temp.player_name Report_Text1.text;
  
temp.reason Report_Text2.text;
  
triggerserver("gui",this.name,"report",temp.player_name,temp.reason);


Here is a quick example on how to trigger serverside to echo.
I suggest you follow proper naming conventions when naming your GUI controls.
http://forums.graalonline.com/forums...ad.php?t=85600

RC sends this message:
Quote:

REPORT: Player name: Player name: Reason: Reason: from: Graal809560

cbk1994 07-21-2012 03:56 AM

Report_Text1 and Report_Text2 are the label controls, not the input boxes. Name your GUI controls properly and it'll be less confusing.

Report_TextEdit1 and Report_TextEdit2 are the ones you want.

BlueMelon 07-21-2012 04:00 AM

Quote:

Originally Posted by cbk1994 (Post 1699870)
Report_Text1 and Report_Text2 are the label controls, not the input boxes. Name your GUI controls properly and it'll be less confusing.

Report_TextEdit1 and Report_TextEdit2 are the ones you want.


:asleep:

It does indeed get confusing.
As you can see.


All times are GMT +2. The time now is 02:00 PM.

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