Error 048: array dimensions do not match
#1

pawn Код:
CMD:car(playerid, params[])
{
    if(!LoggedIn[playerid]) return true;
   
    new Float:dist = 5.0;
   
    new count = 0, test[MAX_CARS], desc[MAX_CARS][32], h = PlayerCar[playerid], Float:x, Float:y, Float:z;
    for(new f = 0; f < MAX_CARS; f++)
    {
        if(CarData[h][CarModel][f] > 400 && CarData[h][CarSpawned][f] == 1)
        {
            GetVehiclePos(CarData[h][CarVID][f], x, y, z);
            if(IsPlayerInRangeOfPoint(playerid, dist, x, y, z))
            {
                test[count] = CarData[h][CarModel][f];
                format(desc[count], 32, "%s", GetVehicleName(CarData[h][CarModel][f]));
                count++;
            }
        }
    }

    if(count > 0)
    {
        ShowModelSelectionMenuEx(playerid, desc, count, "Select Car", MODEL_SELECTION_SCAR, 0.0, 0.0, 90.0);
        carRadius[playerid] = dist;
    }
    return true;
}
Please can someone assist with this issue please?

LINE 27076: ShowModelSelectionMenuEx(playerid, desc, count, "Select Car", MODEL_SELECTION_SCAR, 0.0, 0.0, 90.0);
Reply
#2

Код:
CMD:car(playerid, params[])
{
	if(!LoggedIn[playerid]) return true;
	
	new Float:dist = 5.0, count = 0;
	
	new count = 0, test[MAX_CARS], desc[MAX_CARS][32], h = PlayerCar[playerid], Float:x, Float:y, Float:z;
	for(new f = 0; f < MAX_CARS; f++)
	{
		if(CarData[h][CarModel][f] > 400 && CarData[h][CarSpawned][f] == 1)
		{
			GetVehiclePos(CarData[h][CarVID][f], x, y, z);
			if(IsPlayerInRangeOfPoint(playerid, dist, x, y, z))
			{
				test[count] = CarData[h][CarModel][f];
				format(desc[count], 32, "%s", GetVehicleName(CarData[h][CarModel][f]));
				count++;
			}
		}
	}

	if(count > 0)
	{
		ShowModelSelectionMenuEx(playerid, desc, count, "Select Car", MODEL_SELECTION_SCAR, 0.0, 0.0, 90.0);
		carRadius[playerid] = dist;
	}
	return true;
}
Ermm I think it might be tht?
Reply
#3

Quote:
Originally Posted by JessThompson
Посмотреть сообщение
Код:
CMD:car(playerid, params[])
{
	if(!LoggedIn[playerid]) return true;
	
	new Float:dist = 5.0, count = 0;
	
	new count = 0, test[MAX_CARS], desc[MAX_CARS][32], h = PlayerCar[playerid], Float:x, Float:y, Float:z;
	for(new f = 0; f < MAX_CARS; f++)
	{
		if(CarData[h][CarModel][f] > 400 && CarData[h][CarSpawned][f] == 1)
		{
			GetVehiclePos(CarData[h][CarVID][f], x, y, z);
			if(IsPlayerInRangeOfPoint(playerid, dist, x, y, z))
			{
				test[count] = CarData[h][CarModel][f];
				format(desc[count], 32, "%s", GetVehicleName(CarData[h][CarModel][f]));
				count++;
			}
		}
	}

	if(count > 0)
	{
		ShowModelSelectionMenuEx(playerid, desc, count, "Select Car", MODEL_SELECTION_SCAR, 0.0, 0.0, 90.0);
		carRadius[playerid] = dist;
	}
	return true;
}
Ermm I think it might be tht?
All you added was ", count = 0;"

Look below, it's already there, this isn't a "Undefined" error..
Reply
#4

The native from mSelection:

Код:
ShowModelSelectionMenuEx(playerid, items_array[], item_amount, header_text[], extraid, Float:Xrot = 0.0, Float:Yrot = 0.0, Float:Zrot = 0.0, Float:mZoom = 1.0, dialogBGcolor = 0x4A5A6BBB, previewBGcolor = 0x88888899 , tdSelectionColor = 0xFFFF00AA)
Your code:

Код:
ShowModelSelectionMenuEx(playerid, desc, count, "Select Car", MODEL_SELECTION_SCAR, 0.0, 0.0, 90.0);
Try:

Код:
ShowModelSelectionMenuEx(playerid, desc[count], count, "Select Car", MODEL_SELECTION_SCAR, 0.0, 0.0, 90.0);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)