![]() |
GS2: Serverside player.weapon[s]
For some reason in GScript2 serverside, you cannot access player.weapon or player.weapons, they are undefined. Yet they are defined clientside. Is there any reason for this?
|
Yes need to map them, also need to fix hasweapon()
|
I also see a problem with tokenize(). You can't tokenize by newlines. (str.tokenize("\n")).
|
\n basically tells the NPC that a newline is there, but I believe it simply replaces it with the appropiate character (To what I beleive). It is searching for the string "\n" and not the actual new line.
While we're at it -- I'm not too sure how to do #K(x) anymore. with command doesn't seem to work, nor is npcscount/npcs[i]. I can't seem to call a command by npcs[i].function(); (The function was public, although isn't a weapon). Hrm.. Other problems? I'll post back if I see any. |
Quote:
or ascii(x) to do the opposite Quote:
NPC Code: it works for me... Quote:
i don't know about anything else though edit: i think it's getascii, not ascii? i forget which one is for gs2 |
Quote:
I ended up doing: NPC Code: ;) |
Quote:
|
entao, quoi?
So what would be the equivalent of hasweapon() in GS2? Has it been fixed yet?
PHP Code:
Here's what I tried to do in GS2 to substitute for it: PHP Code:
Btw — addweapon and removeweapon don't work on either clientside or serverside with me for some reason. Am I using it wrong? I've noticed that weapons shouldn't have quotes around them unless they include a symbol or space, so I didn't put any quotes around the actual weaponame. EDIT -- I got an answer from a friend early: hasweapon() can be translated to if (findweapon(weaponnamehere) != null) { ... } |
addweapon/removeweapon only work serverside.
|
| All times are GMT +2. The time now is 11:22 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.