View Single Post
  #1  
Old 05-05-2008, 03:50 AM
Stryke Stryke is offline
Scripter
Join Date: Apr 2008
Posts: 157
Stryke is an unknown quantity at this point
2-dimensional arrays? do they exist?

Because I'm trying to make a Guild system, and it supports up to 100 guilds.
I'm using the array for the list of guilds:

serverr.guild_list

But how would I store the information of the guilds in serverr.guild_list?
If there were 2-D arrays, it would work as simple as this:

serverr.guild_list[5,1] = "Bob";

The 2nd index is 1, which represents the leader of the guild.
The guild with the index of 5, will have the leader set to the player "Bob".
The second index would be used to store all the information about the guilds.

But then again, this would work too, wouldn't it?

server.guild_list[5] = "Champions|Bob"

for(i=0;i<100;i++) {
temp.guild_list = serverr.guild_list[i].tokenize(|);
if(#t(0) == "Champions") {
for(i=0;i<10;i++)
{
this.view_guild_list[i] = #t(i)
}
}
}
Reply With Quote