Argument type mismatch - 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: Argument type mismatch (
/showthread.php?tid=295308)
Argument type mismatch -
Everybody - 05.11.2011
pawn Код:
public LoadCar()
{
new arrCoords[13][64];
new strFromFile2[256];
new File: file = fopen("SRPC/cars.cfg", io_read);
if (file)
{
new idx = 0;
while (idx < sizeof(CarInfo))
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ',');
CarInfo[idx][cModel] = strval(arrCoords[0]);
CarInfo[idx][cLocationx] = floatstr(arrCoords[1]);
CarInfo[idx][cLocationy] = floatstr(arrCoords[2]);
CarInfo[idx][cLocationz] = floatstr(arrCoords[3]);
CarInfo[idx][cAngle] = floatstr(arrCoords[4]);
CarInfo[idx][cColorOne] = strval(arrCoords[5]);
CarInfo[idx][cColorTwo] = strval(arrCoords[6]);
strmid(CarInfo[idx][cOwner], arrCoords[7], 0, strlen(arrCoords[7]), 255);
strmid(CarInfo[idx][cDescription], arrCoords[8], 0, strlen(arrCoords[8]), 255);
CarInfo[idx][cValue] = strval(arrCoords[9]);
CarInfo[idx][cLicense] = strval(arrCoords[10]);
CarInfo[idx][cOwned] = strval(arrCoords[11]);
CarInfo[idx][cLock] = strval(arrCoords[12]);
printf("CarInfo: %d Owner:%s LicensePlate %s",idx,CarInfo[idx][cOwner],CarInfo[idx][cLicense]);
idx++;
if(CarInfo[idx][cOwned] == 0)
{
new vehicle_id, Text3D:vehicle3Dtext, labol;
//Creating TextLabel
format(labol, 300, "Car Name: %s\nCar Price: %d\nColor 1: %d Color 2: %d\nTo buy, go in the car and type /buycar", CarInfo[idx][cDescription], CarInfo[idx][cValue], CarInfo[idx][cColorOne], CarInfo[idx][cColorTwo]);
vehicle3Dtext = Create3DTextLabel(labol, COLOR_RED, 0.0, 0.0, 0.0, 50.0, 0, 1 );
//Attaching Text Label To Vehicle
Attach3DTextLabelToVehicle(vehicle3Dtext, idx, 0.0, 0.0, 2.0);
}
}
}
return 1;
}
The lines with the errors:
pawn Код:
format(labol, 300, "Car Name: %s\nCar Price: %d\nColor 1: %d Color 2: %d\nTo buy, go in the car and type /buycar", CarInfo[idx][cDescription], CarInfo[idx][cValue], CarInfo[idx][cColorOne], CarInfo[idx][cColorTwo]);
vehicle3Dtext = Create3DTextLabel(labol, COLOR_RED, 0.0, 0.0, 0.0, 50.0, 0, 1 );
Both say argument type mismatch (argument 1). Any help? I copied it from the wiki.
Re: Argument type mismatch -
MP2 - 06.11.2011
Labol (..?) needs to be a string.
Re: Argument type mismatch -
GAMER_PS2 - 06.11.2011
i think i agree with MP2
change labol to string
just add this put this on LoadCar
Re: Argument type mismatch -
MP2 - 06.11.2011
I'd set it to 256.