![]() |
GUI Help
Ok so I've never tried to script with a GUI and am just trying to mess around with it a little bit. I want to change a player's name from the GUI Edit Text box, but when I try nothing happens. I can get the player to chat what has been typed in the box when I hit enter, but not change the player's name. I have also tried to send it severside just in case it works like that, but with no luck. I've looked at the Graal Bible and it has the best documentation on GUIs, but like I said I've never messed with GUIs before and need a little help. Thanks as always
- Zie |
script snippets of what your doing would allow me to help better, but player.nick needs to changed serverside.
Try to echo the the text on serverside after it is received, anything? |
Here it's not really anything special lol
PHP Code:
|
Your last function needs to be outside of onweaponfired
|
Alight, but still didn't fix it? The way I call Params[1], is that ok?
|
Ah, look at your OnActionServerside
Also it should be player.nick = params[ 1]; Another thing, your way may work but I usually send the the players account in a param and then reference it to that to change player vars. More thurough I suppose. Eg PHP Code:
PHP Code:
|
Thanks...... sorry bout that just a little tired at 0225. Also is there a command for limiting the amount of characters allowed to be typed in this box?
|
No problem, just rep if it helped ya.
As for your other question, there is no command, the workaround I haved used involves you having to use GUI.onTextChanged() and check with GUI.text.length(), then modify GUI.text if its too long. |
Gotta spread some around....
|
Quote:
Also, PHP Code:
|
Quote:
Not only is it completely unnecessary but it's also a huge security risk. A memory editor could change their account on their end to mimic another player's and carry out actions as them. |
So, I thought the object might have a maxchars variable to limit the amount of characters typed but apparently it doesn't. Anyhoo,
PHP Code:
|
Ok so don't use params[1] because onActionServerside() references the player that used it, and it's a security risk? Thanks for the help!
|
Quote:
Scenario: Changing your own player's chat. (Ignore the fact that you can do it on the client-side...) BAD: PHP Code:
PHP Code:
|
Ok but now it won't change the nick to the input from the Edit text for some reason? I would still need to send that severside and use it, but how would I safely do that?
|
Quote:
|
Yes it does, however, you send the text and use params[1] as well, which is what I was under the impression was unsafe. I don't understand how yours is more secure is what I was trying to say.
|
The unsafe part was sending the account name through the trigger since hackers could manipulate it to affect someone else. Sending a new nickname doesn't have the same safety concerns. There are ways to protect it but completely unnecessary.
|
Quote:
|
Quote:
PHP Code:
PHP Code:
The security problem I referenced was in relation to sending the player's account. The script Twinny posted is fine, as was yours. edit: wow way too slow |
Ah I see now! You were all talking about Mr. Omega's response not my script. And Yes I believe I know how parameters work, also, Thanks for the help!
|
Ok so looking over the GUI controls agian I'm Curious as how to get rows and columns into a GUI. The Graal Bible has some commands, but do you place them in like multi line text? I'm confused on exactly how to implement them
|
| All times are GMT +2. The time now is 09:45 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.