PDA

View Full Version : Strings, Arrays and Problems..


projectigi
02-12-2006, 10:57 PM
Hi,

so i got a DB NPC set flags to

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";

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
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
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
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. :\