enum help
#1

Hi,
This is wrong?
Код:
new MAX_VEH 2

enum CarX
{
    IDveh,
	CarID,
	CarE,
	carEx,
	Text3D:CarOwner
}

new Veh[MAX_VEH][CarX] = 
{
	{0,522, 3, 7},
	{1,411,3, 8}
};
To
Код:
new MAX_VEH 2

enum CarX
{
    IDveh,
	CarID,
	CarE,
	carEx,
	Text3D:CarOwner
}

new Veh[MAX_VEH][MAX_PLAYERS][CarX] = 
{
	{0,522, 3, 7},
	{1,411,3, 8}
};
Error : warning 213: tag mismatch
Reply
#2

Yes, it's wrong.
Do you want to set a vehicle's owner by his "playerid" ?

Код:
enum CarInfos
{
        CarID,
        CarOwner,
	CarModel,
	CarE,
	CarEx,
	Text3D:CarOwner3DText
}

new vInfo[MAX_VEH][CarInfos] = 
{
	{0,-1,522,3,7,Text3D:INVALID_3DTEXT_ID},
	{1,-1,411,3,8,Text3D:INVALID_3DTEXT_ID}
};
Then, you can set a CarOwner for every cars (vehicleid) :
vInfo[vehicleid][CarOwner] = playerid; // It should be a unique indentifier instead of playerid.

And the 3D Text Label :
vInfo[vehicleid][CarOwner3DText] = Create3DTextLabel(...);
Reply
#3

Thanks.
But I need [playerid] not carowner.
Код:
for(new i = 0; i <MAX_VEH; i++) 
{
       Veh[i][playerid][CarE] = Create.....
Reply
#4

If you want to use 4 dimensional arrays, you have to change compilator to https://github.com/Zeex/pawn
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)