VEHICLE PRICE PROBLEM FOR MY VEHICLE DEALERSHIP
#1

I want to set the vehprice[playerid] to the value of the vehicle price but it get a error

Код:
error 006: must be assigned to an array
Код HTML:
new VehiclePrice[][] = {
//price of vehicle
500000,500000,700000,0,500000,500000,0,0,0,0,
400000,5000000,700000,300000,0,5000000,0,0,400000,600000,
0,500000,800000,0,900000,0,500000,0,0,5000000,0,
0,0,0,0,0,500000,0,0,700000,500000,
0,0,0,0,500000,0,0,0,0,0,5000000,0,0,0,0,0,0,800000,400000,
0,2000000,500000,800000,0,0,600000,600000,700000,0,0,600000,0,0,500000,600000,0,
5000000,0,500000,3000000,0,500000,0,0,0,0,10000000,0,800000,0,900000,80000,0,0,0,0,0,0,0,
500000,0,0,0,0,600000,5000000,700000,0,0,0,0,0,0,0,0,500000,500000,500000,0,0,1000000,2500000,
0,0,0,700000,600000,0,500000,0,0,0,900000,600000,800000,700000,0,0,0,500000,5000000,500000,500000,
0,600000,500000,500000,0,500000,500000,700000,0,0,600000,5000000,0,0,900000,900000,2500000,800000,800000,
0,0,700000,500000,700000,0,0,0,0,0,0,0,800000,800000,0,0,600000,700000,1000000,0,0,0,500000,
800000,1000000,0,600000,0,0,0,0,0,0,0,0,0,0,600000,0,3000000,1000000,0,0,0,0,0,0,0,0
};
Код HTML:
new string2[100];
	format(string2,sizeof string2,"PRICE:~n~~G~$ %d",VehiclePrice[carmodelid[playerid] -400]);
	DEALERSHIPTD15 = CreatePlayerTextDraw(playerid,403.000000, 206.000000, string2);
	PlayerTextDrawAlignment(playerid,DEALERSHIPTD15, 2);
	PlayerTextDrawBackgroundColor(playerid,DEALERSHIPTD15, 255);
	PlayerTextDrawFont(playerid,DEALERSHIPTD15, 2);
	PlayerTextDrawLetterSize(playerid,DEALERSHIPTD15, 0.350000, 1.600000);
	PlayerTextDrawColor(playerid,DEALERSHIPTD15, 1414812927);
	PlayerTextDrawSetOutline(playerid,DEALERSHIPTD15, 1);
	PlayerTextDrawSetProportional(playerid,DEALERSHIPTD15, 1);
	PlayerTextDrawSetSelectable(playerid,DEALERSHIPTD15, 0);
Код HTML:
vehprice[playerid] = VehiclePrice[carmodelid[playerid] -400];
Reply
#2

It must be 1D array:
pawn Код:
new VehiclePrice[] = {
and before you subtract 400 from it, make sure the model (carmodelid[playerid]) is valid (between 400 and 611) otherwise run time error 4 will occur.
Reply
#3

Thanks it works !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)