![]() |
Triggering a function
This is my first script that actually operates triggeraction.. I'm getting good at GS2 so step back stefan/skyld lmao!
PHP Code:
|
You should style your code better, or at least make it consistent.
Here's how you should have styled it, following what you've already done. PHP Code:
PHP Code:
PHP Code:
Also, it's a good idea to use findPlayerByCommunityName( pl ) instead. Otherwise, you'll have to use the Graal####### names to kick people. When you sent the trigger, you didn't send any params and instead tokenized the chat on the serverside part of the script. With a script like this, it's better to tokenize the player's chat and send what you need serverside, in case the players chat changes. PHP Code:
A few things that don't really make any difference, but can be changed: - You don't need the temp. prefix in front of a variable if you've already defined this; see how I used that in the above example with temp.tokens. - When sending the trigger, you don't need to use this.name. You can just use name - You can give the 'params' names at the start of a function. Here's an example: PHP Code:
Hope this helps you a bit, like I said, ignore my styling and use whatever you prefer. If I were to rewrite your script using what I said, it would look like this: PHP Code:
|
I'd do this, personally. However, atleast you're understanding params! Great :):)
PHP Code:
http://forums.graalonline.com/forums...ad.php?t=73761 |
Thanks guys, I'm just starting to understand GS2, the way you guys script is another level for me, But I will study it..
Thanks |
| All times are GMT +2. The time now is 02:01 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.