![]() |
gui windows x_X
I'm having a hell of a time trying to learn about these things. I now consider the wikis useless, as a simple listing of commands has gotten me nowhere. :whatever: Anyone know a better site, or willing to pass on some knowledge? I've been working/searching for a while, and all I got is a window with some useless tabs that won't reaopen after it's closed >_< . I'm trying to create a tool for players and staff for various commands and options. I'm NOT asking for a script, small examples, or a good site to learn would be nice though.
|
PHP Code:
The following code will show you how to handle the event of a button being clicked: PHP Code:
PHP Code:
The first parameter passed to newActionName() would be the object of the button. PHP Code:
PHP Code:
PHP Code:
|
<3 ^^ thanks, I'll get to work =D
|
How do i get it to come back after it's closed? I've been using onWeaponfired() to bring it up, but it only works once
|
Quote:
PHP Code:
|
I'm not sure, recalling it won't bring it back unless it's minimized.
Also, how do I clear buttons for creating a new window? |
When someone clicks on the X then it is by default just hidden, you can show it again by calling windowname.show() or windowname.showtop() (to make it show on top of all other windows and giving it the key focus).
What do you mean with clearing buttons? |
when you say
thiso.variablename does the o after the word this stand for object? or what? |
Forgive me, I'm new with these and gs2, but can you do text input with these? For example, a jailing system that would allow text input? (I just need it to ask for some text, and send the parameters serverside, so really all i need is text input that the npc can read)
|
Quote:
Think of it this way: PHP Code:
|
There is a list of variable prefixes for the old scripting engine at http://wiki.graal.net/index.php/Crea...iable_Prefixes,
someone should do that for the new scripting engine may be. There is now also a playero prefix. The 'o' means 'original', thiso and playero always refer to the original this and player variables when the script execution started. |
I've been thinking about using text display on the gui, and a loop that stores your keyboard input, then increments an array to store it, giving the text output, then when you push the buton for jail, disconnect, etc (staff npc) it would use that array, along with a serverside action, and getplayer, to do that action to them. However, I want to know it there is an easier way, through gui text input
|
Quote:
|
thanks, this is what I currently have for a staff weapon, it's not calling the action, or the parameters are wrong. (I'm trying gs2, finally)
PHP Code:
|
It is calling the action, but im having trouble getting it to send the text of Player.text and to read it.
|
It's not an excellent idea using the object "player", since that is already reserved for the current player.
PHP Code:
PHP Code:
PHP Code:
PHP Code:
Most of what's there is a mix of old gscript and new gscript, so you should iron those kinks out and work purely in new gscript. |
Made those fixes, but when the action is called, params[1] is just pl_acct.text (new name of that object)
|
triggeraction(0, 0, "serverside", "Staff Control", "jail", pl_acct.text, Reason.text);
|
I also added in a numerical value, the time for jailings (DR has an auto unjail system) however, it's not sending the time right it's params[3]*3600 and it shows up at literally params[3]*3600 (which may as well be 0) since gs2 doesn't have a #v() what do I do?
Also, I had hoped to display text like this: player.chat="Jailed for " params[2] " for " params[3] " hours"; bu obviously, that doesn't work (params[2] is the reason, 3 is the time). |
Quote:
Quote:
PHP Code:
|
there are no quotes around the parameter, it's just params[3]*3600 :(
And thanks, the text stuff make me miss the old format a bit :( |
Read what Rick said.
PHP Code:
|
nevermind, i was setting the string in GS1 x_X
|
PHP Code:
|
Quote:
PHP Code:
|
PHP Code:
Quote:
|
Quote:
|
<3 thanks!!
|
| All times are GMT +2. The time now is 07:29 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.