Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Array problems (https://forums.graalonline.com/forums/showthread.php?t=75541)

HolySheepy 07-15-2007 11:10 PM

Array problems
 
Hi,

so i did

PHP Code:

function onCreated()
  {
  
this.includelevels = { "test.nw" };
  
player.chat this.includelevels.indexplayer.level );
  } 

it says -1

PHP Code:

function onCreated()
  {
  
this.includelevels = { "test.nw" };
  
player.chat this.includelevels];
  } 

it says test.nw

PHP Code:

function onCreated()
  {
  
this.includelevels = { "test.nw" };
  
player.chat this.includelevels] == player.level;
  } 

it says 1

PHP Code:

function onCreated()
  {
  
this.includelevels = { "test.nw", };
  
player.chat this.includelevels.indexplayer.level );
  } 

it says -1

PHP Code:

function onCreated()
  {
  
this.includelevels = { "test.nw""blub.nw" };
  
player.chat this.includelevels.indexplayer.level );
  } 

it says -1

PHP Code:

function onCreated()
  {
  
this.includelevels = { };
  
this.includelevels.add"test.nw" );
  
player.chat this.includelevels.indexplayer.level );
  } 

it says 0

so why? i dont wanna add every single level with add() Oo
and the { } worked fine like a week ago

Tolnaftate2004 07-15-2007 11:27 PM

Tack on .name to 'player.level'.

Inverness 07-15-2007 11:35 PM

player.level is an object.

killerogue 07-16-2007 12:24 AM

Out of observation, I don't mean to be rude....but, your styling is completely retarded. O.o At first glance I hardly understood what it was doing.

xXziroXx 07-16-2007 02:47 AM

As the other's already stated, try using player.level.name instead of player.level. Should do the trick! :)

Gambet 07-16-2007 04:07 AM

Quote:

Originally Posted by killerogue (Post 1330969)
Out of observation, I don't mean to be rude....but, your styling is completely retarded. O.o At first glance I hardly understood what it was doing.



Yeah, I told him I disliked his styling as well for it didn't make much sense but that's his own personal preference. The problem comes when other people have to edit his work, for they're forced to deal with his styling. :frown:

HolySheepy 07-16-2007 09:55 AM

Quote:

Originally Posted by Gambet (Post 1331053)
Yeah, I told him I disliked his styling as well for it didn't make much sense but that's his own personal preference. The problem comes when other people have to edit his work, for they're forced to deal with his styling. :frown:

well dunno, but for me my styling makes more sense than yours :P
but thanks for helping

a year ago i had styling like
PHP Code:

function meh() {
  
blubcommands


or
PHP Code:

function meh()
{
  
blubcommands;


then i started working for a serv, the previous scripter quit and he styled it like im doing it now, i first found it hard to read, but after editing some scripts i liked that style and now i think its easier to read than the other styles i posted above :o
oh yeah thats a feature request, brb


All times are GMT +2. The time now is 09:53 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.