SA-MP Forums Archive
array help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: array help (/showthread.php?tid=369122)



array help - cssbart - 15.08.2012

Код:
new licenseplates[6] = { {"U76T 989"}, {"25ER OP2"}, {"6H7N UI9"}, {"GAY1 ONE"}, {"HAS1 ALT"}, {"U232 OPE"} };
i get this error on that line and i dont see the problem
fugitiveSFv2.0.pwn(226) : error 008: must be a constant expression; assumed zero



you may need this
Код:
for(new h = 0; h < sizeof(HouseInfo); h++)
	{
		if (gdebug >= 1){printf("HouseInfo[%d][hVec] %d",h,HouseInfo[h][hVec]);}
		CreateVehicle(HouseInfo[h][hVec], HouseInfo[h][hVecx], HouseInfo[h][hVecy], HouseInfo[h][hVecz], HouseInfo[h][hVecr], HouseInfo[h][hVcol1], HouseInfo[h][hVcol2], -1);
		gCarLock[h+1] = 0;
        new prand = random(sizeof(licenseplates));
        SetVehicleNumberPlate(h+1, licenseplates[prand]);
	}



Re : array help - Sandiel - 15.08.2012

On top of your script
pawn Код:
new licenseplates[][] =
{
      {"U76T 989"},
      {"25ER 0F2"},
      {},
       // So on and so forth, remember, the last license plate should not have a "," at the end ;)
};



AW: array help - Kwashiorkor - 15.08.2012

Код:
new licenseplates[][] = {"U76T 989","25ER 0F2","and so on"};