SA-MP Forums Archive
VEHICLE PRICE PROBLEM FOR MY VEHICLE DEALERSHIP - 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: VEHICLE PRICE PROBLEM FOR MY VEHICLE DEALERSHIP (/showthread.php?tid=579115)



VEHICLE PRICE PROBLEM FOR MY VEHICLE DEALERSHIP - JawsPlus - 24.06.2015

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];



Re: VEHICLE PRICE PROBLEM FOR MY VEHICLE DEALERSHIP - Konstantinos - 24.06.2015

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.


Re: VEHICLE PRICE PROBLEM FOR MY VEHICLE DEALERSHIP - JawsPlus - 25.06.2015

Thanks it works !