SA-MP Forums Archive
Function IsABoat - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Function IsABoat - Errors (/showthread.php?tid=65046)



Function IsABoat - Errors - Joel104 - 09.02.2009

Hi,

I want to change the IsABoat function to work with VehicleModels.

Код:
public IsABoat(carid, playerid)
  vehid[playerid] = GetPlayerVehicleID(playerid);
//line1812
if(GetVehicleModel(vehid[playerid]) == 472 || GetVehicleModel(vehid[playerid]) == 473 || GetVehicleModel(vehid[playerid]) == 493 || GetVehicleModel(vehid[playerid]) == 595 || GetVehicleModel(vehid[playerid]) == 484 || GetVehicleModel(vehid[playerid]) == 430 || GetVehicleModel(vehid[playerid]) == 453 || GetVehicleModel(vehid[playerid]) == 452 || GetVehicleModel(vehid[playerid]) == 446 || GetVehicleModel(vehid[playerid]) == 454)
	{
		return 1;
	}
	return 0;
}
but now, this error:

E:\gtasa\gamemodes\compton.pwn(1812) : error 010: invalid function or declaration
E:\gtasa\gamemodes\compton.pwn(1814) : error 010: invalid function or declaration
E:\gtasa\gamemodes\compton.pwn(1816) : error 010: invalid function or declaration

please help =/


Re: Function IsABoat - Errors - samp-protector332688 - 09.02.2009

Quote:
Originally Posted by Joel104
Hi,

I want to change the IsABoat function to work with VehicleModels.

Код:
public IsABoat(carid, playerid)
  vehid[playerid] = GetPlayerVehicleID(playerid);
//line1812
if(GetVehicleModel(vehid[playerid]) == 472 || GetVehicleModel(vehid[playerid]) == 473 || GetVehicleModel(vehid[playerid]) == 493 || GetVehicleModel(vehid[playerid]) == 595 || GetVehicleModel(vehid[playerid]) == 484 || GetVehicleModel(vehid[playerid]) == 430 || GetVehicleModel(vehid[playerid]) == 453 || GetVehicleModel(vehid[playerid]) == 452 || GetVehicleModel(vehid[playerid]) == 446 || GetVehicleModel(vehid[playerid]) == 454)
	{
		return 1;
	}
	return 0;
}
but now, this error:

E:\gtasa\gamemodes\compton.pwn(1812) : error 010: invalid function or declaration
E:\gtasa\gamemodes\compton.pwn(1814) : error 010: invalid function or declaration
E:\gtasa\gamemodes\compton.pwn(1816) : error 010: invalid function or declaration

please help =/
kk try to check if skin or id of cars are gone wrong or see if the commands are wrongly appeared!


Re: Function IsABoat - Errors - Joel104 - 09.02.2009

hmm, dont understand, what do you mean?


Re: Function IsABoat - Errors - Backspin - 09.02.2009

Try this:

Код:
public IsABoat(carid)
{
	new modelid = GetVehicleModel(carid);
	if(modelid == 430 || modelid == 446 || modelid == 452 || modelid == 453 || modelid == 454 || modelid == 472 || modelid == 473 || modelid == 484 || modelid == 493 || modelid == 595)
	{
		return 1;
	}
	return 0;
}



Re: Function IsABoat - Errors - Joel104 - 09.02.2009

Quote:
Originally Posted by Backspin
Try this:

Код:
public IsABoat(carid)
{
	new modelid = GetVehicleModel(carid);
	if(modelid == 430 || modelid == 446 || modelid == 452 || modelid == 453 || modelid == 454 || modelid == 472 || modelid == 473 || modelid == 484 || modelid == 493 || modelid == 595)
	{
		return 1;
	}
	return 0;
}
perfect, thanks.