![]() |
setting a var not working
For the life of me I dont know why. The chat "caught one" comes up, but nothing after that.
PHP Code:
|
You can't use 'var' it's one of those undocumented keywords.
Besides why not just do: clientr.fish.(@fishtype[i])++; instead the whole temp.var thing. I'd also recommend making a function for getting a random fish type, something like this: PHP Code:
|
Try
PHP Code:
The only things GS2 will reference are objects and arrays. |
shouldn't you be doing int(random(0,6)); from what I remember random doesn't automatically round it's results.
|
That sets now, but sets wrong. Its just setting as clientr.fish.fishtype=1 in flags, as it should be where fishtype is the actual fish type, like clientr.fish.cod=1 instead. :/
And the stupid ani wont set, also tried setAni. Fixed the random, it was a mistake, but was still working somehow regardless. |
Quote:
|
Might want to do something like:
temp.fishtype[int(random(0, temp.fishtype.size())+.5)] So it will round up, instead of just getting rid of the floating point, or else it may never get a "Hardhead." I'm not sure though. |
Quote:
|
hmmm
HTML Code:
randomstring(temp.fishtype) |
Quote:
|
| All times are GMT +2. The time now is 12:14 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.