Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Strings, Arrays and Problems.. (https://forums.graalonline.com/forums/showthread.php?t=64074)

projectigi 02-12-2006 10:57 PM

Strings, Arrays and Problems..
 
Hi,

so i got a DB NPC set flags to
NPC Code:

rights_projectigi={1,1,0,1,1};


then i used
req_player is a player object
reqq_player is set to projectigi
means reqq_player="projectigi";
NPC Code:

with(findnpc("Foobar")){
req_player.clientr.loadrights = this.("rights_"@reqq_player);
}



so when i try to do player.chat=clientr.loadrights[0];
on clientside then my player says {1

thats the problem i need him to see it as 1
so the first thing of an array
but i cant just get the {} away because then when i send an array like this blah={1,1,0,1}; it woudl be blah=1,1,0,1; and that would mess up the triggeractions param order

ZeLpH_MyStiK 02-12-2006 11:02 PM

array = {1,2,2390};
array[0] == 1
array[1] == 2
array[3] == 2390
Or if you want to use a string list, use quotes

projectigi 02-12-2006 11:28 PM

well they should be booleans
and as i posted i set it like this
rights_projectigi={1,1,0,1,1};

then gave it with this to clientside



with(findnpc("Foobar")){

req_player.clientr.loadrights = this.("rights_"@reqq_player);

}

but on clientside player.chat=clientr.loadrights[0];
it says {1

Rick 02-12-2006 11:34 PM

this.(@"rights_" @ reqq_player)

projectigi 02-12-2006 11:37 PM

still {1 :(
clientr.loadrights={1,1,1,1,1} <- from /open projectigi

Rick 02-12-2006 11:45 PM

Is your client Graal2?

projectigi 02-12-2006 11:57 PM

no its V4

Riot 02-12-2006 11:59 PM

If I remember correctly, you have to use the old format for arrays when you're dealing with flags in DB-NPCs and Player Attributes (if editing from RC/NC). By the looks of it you're trying to use the new format.

projectigi 02-13-2006 12:01 AM

old format? new format? huh?

Riot 02-13-2006 12:10 AM

1,1,1,1,1 instead of {1,1,1,1,1}

ZeLpH_MyStiK 02-13-2006 06:54 AM

Quote:

Originally Posted by Riot
1,1,1,1,1 instead of {1,1,1,1,1}

Wth?
1,1,1,1,1 is a string array, while
{1,1,1,1,1} is an array.

napo_p2p 02-13-2006 06:56 AM

Quote:

Originally Posted by ZeLpH_MyStiK
Wth?
1,1,1,1,1 is a string array, while
{1,1,1,1,1} is an array.

If you look at the flags in a database NPC, they are like:
1,1,1,1,1

and not:
{1,1,1,1,1}


Don't ask me why. It just is :frown:.

ZeLpH_MyStiK 02-13-2006 06:57 AM

Quote:

Originally Posted by napo_p2p
If you look at the flags in a database NPC, they are like:
1,1,1,1,1

and not:
{1,1,1,1,1}


Don't ask me why. It just is :frown:.

Oh, I thought he meant setting them.

Edit: Wait a minute...It doesn't matter how it looks, since you can't set the way it shows up in the flags of dbnpcs. :\


All times are GMT +2. The time now is 06:21 AM.

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