[HELP] Multi dimensional arrays
#1

Hi at all!
So, I have this
pawn Код:
new HouseOwner[128];
And I assign a string:
pawn Код:
HouseOwner[128] = "LolMan95";
But, if I want to assign another array:
pawn Код:
new HouseOwner[MAX_PLAYERS][128];
HouseOwner[playerid][128] = "LolMan95";
It give me some errors like: "expression has no effect".
How can I assign a string to a variabile with two arrays?
Reply
#2

Код:
#define MAX_HOUSES 500 //You can change that

enum House_Info
{
     houseOwner[128],
}
new HouseInfo[MAX_HOUSES][House_Info];

-----------------------
format(HouseInfo[houseid][houseOwner],128,"LolMan95");
Код:
new HouseOwner[MAX_PLAYERS][128];

-------------------------------------
format(HouseOwner[playerid],128,"LolMan95");
Reply
#3

pawn Код:
new HouseOwner[MAX_PLAYERS][128];
format(HouseOwner[playerid],sizeof(HouseOwner),"LolMan95");
you format a string not assign it!
Reply
#4

Quote:

you format a string not assign it!

This was what I needed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)