Vehicle System HELP
#1

Hello, i have edited the Vehicle System dynamic on Carlito's RolePlay..
This is a code:
Код HTML:
public LoadDynamicCars()
{
	new arrCoords[10][64];
	new strFromFile2[256];
	new File: file = fopen("CRP_Scriptfiles/Cars/carspawns.cfg", io_read);
	if (file)
	{
		new idx;
		while (idx < sizeof(DynamicCars))
		{
			fread(file, strFromFile2);
			split(strFromFile2, arrCoords, '|');
			DynamicCars[idx][CarModel] = strval(arrCoords[0]);
			DynamicCars[idx][CarX] = floatstr(arrCoords[1]);
			DynamicCars[idx][CarY] = floatstr(arrCoords[2]);
			DynamicCars[idx][CarZ] = floatstr(arrCoords[3]);
			DynamicCars[idx][CarAngle] = floatstr(arrCoords[4]);
			DynamicCars[idx][CarColor1] = strval(arrCoords[5]);
			DynamicCars[idx][CarColor2] = strval(arrCoords[6]);
			DynamicCars[idx][FactionCar] = strval(arrCoords[7]);
			DynamicCars[idx][CarType] = strval(arrCoords[8]);
			strmid(DynamicCars[idx][Owner], arrCoords[9], 0, strlen(arrCoords[1]), 255);
			
			new vehicleid = CreateVehicle(DynamicCars[idx][CarModel],DynamicCars[idx][CarX],DynamicCars[idx][CarY],DynamicCars[idx][CarZ],DynamicCars[idx][CarAngle],DynamicCars[idx][CarColor1],DynamicCars[idx][CarColor2], -1);

			if(DynamicCars[idx][FactionCar] != 255)
			{
				SetVehicleNumberPlate(vehicleid, DynamicFactions[DynamicCars[idx][FactionCar]][fName]);
				SetVehicleToRespawn(vehicleid);
			}

			idx++;
		}
		fclose(file);
	}
	return 1;
}
public SaveDynamicCars()
{
	new idx;
	new File: file2;
	while (idx < sizeof(DynamicCars))
	{

		new coordsstring[512];
		format(coordsstring, sizeof(coordsstring), "%d|%f|%f|%f|%f|%d|%d|%d|%d|%s\n",
		DynamicCars[idx][CarModel],
		DynamicCars[idx][CarX],
		DynamicCars[idx][CarY],
		DynamicCars[idx][CarZ],
		DynamicCars[idx][CarAngle],
		DynamicCars[idx][CarColor1],
		DynamicCars[idx][CarColor2],
		DynamicCars[idx][FactionCar],
		DynamicCars[idx][CarType],
		DynamicCars[idx][Owner]);

		if(idx == 0)
		{
			file2 = fopen("CRP_Scriptfiles/Cars/carspawns.cfg", io_write);
		}
		else
		{
			file2 = fopen("CRP_Scriptfiles/Cars/carspawns.cfg", io_append);
		}
		fwrite(file2, coordsstring);
		idx++;
		fclose(file2);
	}
	return 1;
}
you can see the string Owner added by me..
I need a script that if the player enters the vehicle if the string Owner equal to the Nickname the player enter in vehicle, else Remove player from vehicle.. Sorry my bad english, i'm a italian.. I have a try create this code:
Код HTML:
		if(DynamicCars[vehicleid][Owner] == GetName)
		{
                } else {
                RemovePlayerFromVehicle(playerid);
                }
Error
C:\Users\Tony\Desktop\Atlantis City Role Play GameMode\gamemodes\crp.pwn(27519) : error 076: syntax error in the expression, or invalid function call

Please help me fix this code in the OnPlayerStateChange
Reply


Messages In This Thread
Vehicle System HELP - by Fab10 - 20.07.2010, 14:26
Re: Vehicle System HELP - by Last_Stand_Guardian - 20.07.2010, 14:47
Re: Vehicle System HELP - by Fab10 - 20.07.2010, 15:15
Re: Vehicle System HELP - by Fab10 - 20.07.2010, 15:27
Re: Vehicle System HELP - by Last_Stand_Guardian - 20.07.2010, 15:28
Re: Vehicle System HELP - by Fab10 - 20.07.2010, 16:10
Re: Vehicle System HELP - by Fab10 - 20.07.2010, 16:11
Re: Vehicle System HELP - by DJDhan - 20.07.2010, 16:27

Forum Jump:


Users browsing this thread: 1 Guest(s)