![]() |
onActionServerside
NPC Code: The script only works when the player.chat command is uncommented. Anyway to fix this / is their a different way for triggeractions in GS2? |
Firstly, I'm not sure if you can use a switch immediately after a case.
Second, you've given the function two argument variables; why are you using params? |
Ew @ double switch case.
|
*Points the finger at Loriel*
So, how is this fixable? |
seems to not like going right from a case to another switch... a bug is my guess
|
Then is their anyway I can do it as how I am trying to?
I am trying to make it do like this: if (strequals(#p(0),stats)) { if (strequals(#p(1),hurt)) // Hurt } How would I do something like that in gscript2 then? |
if (foo == bar)
foo and bar are variables. to see whether foo equals "test" (the string), do if (foo == "test") like you'd compare integers in GS1, just put quotes around strings. |
Quote:
NPC Code: |
Hmm, that would work..but what is switch for then?
|
Quote:
NPC Code: while the elseif form of that would be much longer |
So it is some sort of replacement of else?
EX: if (playerchats) { if (strequals(#c,boo)) setplayerprop#c,boo; else if (strequals(#c,bam)) setplayerprop#c,bam; else if (strequals(#c,woo)) setplayerprop#c,woo; } |
Quote:
|
Quote:
|
Err O.o?
|
Quote:
PHP Code:
|
Why set test?
And not use switch (player.chat) ??? |
| All times are GMT +2. The time now is 06:20 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.