SA-MP Forums Archive
tag mismatch / format / other errors - 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: tag mismatch / format / other errors (/showthread.php?tid=581745)



tag mismatch / format / other errors - thaKing - 15.07.2015

I couldn't find those mistakes, for I'm asking for help here.
Well, check the codes, on error lines I put "// LINE [error_line]", so maybe you will find the problem and help me solve it.

Код:
C:\Users\sekseriic\Desktop\sRolePlay\gamemodes\roleplay.pwn(358) : error 035: argument type mismatch (argument 3)
C:\Users\sekseriic\Desktop\sRolePlay\gamemodes\roleplay.pwn(359) : error 035: argument type mismatch (argument 3)
C:\Users\sekseriic\Desktop\sRolePlay\gamemodes\roleplay.pwn(361) : error 035: argument type mismatch (argument 2)
C:\Users\sekseriic\Desktop\sRolePlay\gamemodes\roleplay.pwn(351) : warning 203: symbol is never used: "vehPlate"
C:\Users\sekseriic\Desktop\sRolePlay\gamemodes\roleplay.pwn(351) : warning 203: symbol is never used: "vehOwner"
C:\Users\sekseriic\Desktop\sRolePlay\gamemodes\roleplay.pwn(377) : error 047: array sizes do not match, or destination array is too small
C:\Users\sekseriic\Desktop\sRolePlay\gamemodes\roleplay.pwn(843) : error 035: argument type mismatch (argument 5)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Код:
stock CreateVehicleEx(vehModel, Float:vehPark[4], vehColor1, vehColor2, vehOwner, vehPlate)// LINE 351
{
	new vehID = GetAvailableVehicleID();
	VehicleData[vehID][vModel] = vehModel;
	VehicleData[vehID][vPark] = vehPark;
	VehicleData[vehID][vColor1] = vehColor1;
	VehicleData[vehID][vColor2] = vehColor2;
    format(VehicleData[vehID][vOwner], MAX_PLAYER_NAME, vehOwner);// LINE 358
    format(VehicleData[vehID][vPlate], MAX_NUMBER_PLATE, vehPlate);// LINE 359
    VehicleData[vehID][vID] = CreateVehicle(vehModel, vehPark[0], vehPark[1], vehPark[2], vehPark[3], vehColor1, vehColor2, -1);
    SetVehicleNumberPlate(vehID, vehPlate);// LINE 361
	SetVehicleToRespawn(vehID);
	vCreated[vehID] = true;
	return vehID;
}
Код:
stock LoadVehicle(i)
{
	new path[32];
	format(path, sizeof(path), "vehicles/%d.ini", i);

	if(fexist(path))
	{
		INI_ParseFile(path, "LoadVehicleFromFile", .bExtra = true, .extra = i);
		VehicleData[i][vFileID] = i;
		CreateVehicleEx(VehicleData[i][vModel], VehicleData[i][vPark], VehicleData[i][vColor1], \
		VehicleData[i][vColor2], VehicleData[i][vOwner], VehicleData[i][vPlate]);// LINE 377
		printf("[vehicle system] Vehicle %i has been loaded.", i);
	}
}
Код:
CMD:veh(playerid, params[]) return cmd_vehicle(playerid, params);
CMD:vehicle(playerid, params[])
{
	if (PlayerData[playerid][pAdminLevel] > 3) {
		new vehModel, vehColor1, vehColor2, vehPlate[8];
		if (sscanf(params, "iiis[8]", vehModel, vehColor1, vehColor2, vehPlate))
		    return SendSyntaxMessage(playerid, "/veh(icle) [modelid] [color1] [color2] [number plate]");
		    
		if (vehModel < 400 || vehModel > 611)
		    return SendErrorMessage(playerid, "Nederīgs modelid! (lieto: 400-611)");
		    
		if (vehColor1 < 0 || vehColor1 > 255)
		    return SendErrorMessage(playerid, "Nederīgs color1! (lieto: 0-255)");

        if (vehColor1 < 0 || vehColor1 > 255)
		    return SendErrorMessage(playerid, "Nederīgs color2! (lieto: 0-255)");

		//new Float: pX, Float: pY, Float: pZ, Float: pA;
		new Float:pLoc[4];
		new strPlayerName[MAX_PLAYER_NAME], vehID;
		GetPlayerPos(playerid, pLoc[0], pLoc[1], pLoc[2]);
		GetPlayerFacingAngle(playerid, pLoc[3]);
		GetPlayerName(playerid, strPlayerName, MAX_PLAYER_NAME);

		vehID = CreateVehicleEx(vehModel, pLoc, vehColor1, vehColor2, strPlayerName, vehPlate);// LINE 843
		PutPlayerInVehicle(playerid, vehID, 0);
	} else {
	    AccessDenied;
	}
	return 1;
}



Re: tag mismatch / format / other errors - SpikeSpigel - 15.07.2015

For 351 :

pawn Код:
stock CreateVehicleEx(vehModel, Float:vehPark[4], vehColor1, vehColor2)// LINE 351
{
    new vehID = GetAvailableVehicleID();
    VehicleData[vehID][vModel] = vehModel;
    VehicleData[vehID][vPark] = vehPark;
    VehicleData[vehID][vColor1] = vehColor1;
    VehicleData[vehID][vColor2] = vehColor2;
    format(VehicleData[vehID][vOwner], MAX_PLAYER_NAME, vehOwner);// LINE 358
    format(VehicleData[vehID][vPlate], MAX_NUMBER_PLATE, vehPlate);// LINE 359
    VehicleData[vehID][vID] = CreateVehicle(vehModel, vehPark[0], vehPark[1], vehPark[2], vehPark[3], vehColor1, vehColor2, -1);
    SetVehicleNumberPlate(vehID, vehPlate);// LINE 361
    SetVehicleToRespawn(vehID);
    vCreated[vehID] = true;
    return vehID;
}
You need to delete vehPlate and vehOwner cuz u didn't used 'em .


Re: tag mismatch / format / other errors - zPain - 15.07.2015

pawn Код:
stock CreateVehicleEx(vehModel, Float:vehPark[4], vehColor1, vehColor2, vehOwner[], vehPlate[])



Re: tag mismatch / format / other errors - thaKing - 16.07.2015

Still got an error:
Код:
C:\Users\sekseriic\Desktop\sRolePlay\gamemodes\roleplay.pwn(377) : error 047: array sizes do not match, or destination array is too small
Код:
stock LoadVehicle(i)
{
	new path[32];
	format(path, sizeof(path), "vehicles/%d.ini", i);

	if(fexist(path))
	{
		INI_ParseFile(path, "LoadVehicleFromFile", .bExtra = true, .extra = i);
		VehicleData[i][vFileID] = i;
		CreateVehicleEx(VehicleData[i][vModel], VehicleData[i][vPark], VehicleData[i][vColor1], \
		VehicleData[i][vColor2], VehicleData[i][vOwner], VehicleData[i][vPlate]);// LINE 377
		printf("[vehicle system] Vehicle %i has been loaded.", i);
	}
}



Re: tag mismatch / format / other errors - mamorunl - 16.07.2015

I am guessing it is this one:
VehicleData[i][vPark]

that does not match in sizes


Re: tag mismatch / format / other errors - thaKing - 16.07.2015

Quote:
Originally Posted by mamorunl
Посмотреть сообщение
I am guessing it is this one:
VehicleData[i][vPark]

that does not match in sizes
I thought that too, but error is in second line of CreateVehicleEx.