Quote:
Originally Posted by Switch
PHP Code:
weps.tokenize("/");
Will tokenize everything between /'s.
|
No, no, no!
'weps' in the weapon object, not the name of the weapon.
If you want the last part:
PHP Code:
for (temp.weps : player.weapons) {
temp.tokens = weps.name.tokenize("/");
temp.realName = tokens[tokens.size() - 1];
}
You also might want to name the temporary weapon object 'wep' instead of 'weps' as the latter indicates that it is a list of weapons rather than a single weapon.