Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   GUI.findtext(str)? (https://forums.graalonline.com/forums/showthread.php?t=134259358)

xMane 05-30-2010 09:21 PM

GUI.findtext(str)?
 
how would this commands work?
this.hirefind = player.account;
if(Biz_HireEdit.findtext(this.hirefind))
player.chat="yipeeee!";

cbk1994 05-30-2010 09:25 PM

What exactly are you trying to accomplish?

xMane 05-30-2010 09:26 PM

also how i do this clientside or serverside or make it work.
function onTimeout()
{
this.i = findplayer ( Biz_BizPlayerList.getselectedtext() );
Biz_PlayerRank.settext(this.i.clientr.bizinfo[1]);
Biz_PlayerAdmin.settext(this.i.clientr.bizinfo[2]);
Biz_PlayerName.settext(@Biz_BizPlayerList.getselec tedtext());
setTimer(0.05);
}
it only works for my player.

xMane 05-30-2010 09:27 PM

Quote:

Originally Posted by cbk1994 (Post 1579462)
What exactly are you trying to accomplish?

if a player is not yet on a list it can be added
like if(!GUI.findtext(Graal757488))GUI.addrow(1,Graal75 7488);
get me?

fowlplay4 05-30-2010 09:39 PM

Please wrap code in PHP tags to maintain readability.

PHP Code:

GuiContextMenuCtrl.findtext(str) - returns integer row index
GuiPopUpEditCtrl
.findtext(str) - returns integer
GuiPopUpEditCtrl
.findtext(str) - returns integer row index
GuiPopUpMenuCtrl
.findtext(str) - returns integer
GuiPopUpMenuCtrl
.findtext(str) - returns integer row index
GuiTabCtrl
.findtext(str) - returns integer row index
GuiTextListCtrl
.findtext(str) - returns integer row index
GuiContextMenuCtrl
.findtextid(str) - returns integer row id
GuiPopUpEditCtrl
.findtextid(str) - returns integer row id
GuiPopUpMenuCtrl
.findtextid(str) - returns integer row id
GuiTabCtrl
.findtextid(str) - returns integer row id
GuiTextListCtrl
.findtextid(str) - returns integer row id 

If it doesn't it find it, it should be returning a -1.

PHP Code:

if (object.findtext("Hello World") >= 0) {
  
// Hello World was found in the list.
} else {
  
// Hello World was not found in the list.



xMane 05-30-2010 11:28 PM

?
 
one last thing. i want a list to keep the accounts on it everytime i open it.
like server side how would i do this?
like
serveroptions:
PHP Code:

serverr.biz1names=graal757488,n00bcakes 

script:
PHP Code:

 GUI.addrow(serverr.biz1names); 

????

fowlplay4 05-30-2010 11:41 PM

You can access the your staff list on the server-side with code like this:

temp.staff = serveroptions.staff.tokenize(",");

Personally I'd use triggerserver, retrieve the staff list, and send the list to the client with triggerclient instead of serverr variable.

xMane 05-30-2010 11:53 PM

ok now how would i make it add all the accounts in the serveroptions
like
temp.staff[temp.staff.size] or wat goes in [] to get all the staff on the list ? not just 1
because its a mutli-line gui

fowlplay4 05-30-2010 11:56 PM

In my example, temp.staff would be the equivalent to:

temp.staff = {"account", "account"};

You'll have to use a for loop to go through the array and add the accounts one at a time into your GUI.

For Loop Example: http://forums.graalonline.com/forums...hp?t=134259285

xMane 05-31-2010 12:07 AM

so the correct way to do this how? i keep trying but idk what to do here.
PHP Code:

  this.hirebiz clientr.bizname;
  
this.bizstaff serverr.(@this.hirebiz@"accounts").tokenize(",");
  for (
temp.0this.bizstaff.size(); ++)
  
this.bizstaffsize this.bizstaff[x];
Biz_BizPlayerList.addrow(this.amountrow,this.bizstaff[this.bizstaffsize]); 

or how would this be? because that code is not working x.x

xAndrewx 05-31-2010 01:54 AM

Quote:

Originally Posted by xMane (Post 1579490)
so the correct way to do this how? i keep trying but idk what to do here.
PHP Code:

  this.hirebiz clientr.bizname;
  
this.bizstaff serverr.(@this.hirebiz@"accounts").tokenize(",");
  for (
temp.0this.bizstaff.size(); ++)
  
this.bizstaffsize this.bizstaff[x];
Biz_BizPlayerList.addrow(this.amountrow,this.bizstaff[this.bizstaffsize]); 

or how would this be? because that code is not working x.x


Ahh, close
HTML Code:

  for (temp.x; temp.x < this.bizstaff.size(); temp.x++) {
    Biz_BizPlayerList.addRow(temp.x, this.bizstaff[temp.x]);
  }



All times are GMT +2. The time now is 05:01 AM.

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