SA-MP Forums Archive
vehicleid changes on new vehicle spawn - 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: vehicleid changes on new vehicle spawn (/showthread.php?tid=90494)



vehicleid changes on new vehicle spawn - SiJ - 08.08.2009

Hey,
I've got this:
Код:
new RifaVeh[5];

//OnGameModeInit
RifaVeh[0] = CreateVehicle(421,-2309.5354,-316.1686,58.5614,302.1256,65,1,300); // San Fierro Rifa's leader car z= 59.5614
RifaVeh[1] = CreateVehicle(405,-2300.0459,-290.7169,56.1315,213.9158,65,1,300); // San Fierro Rifa's members car z= 56.1315
RifaVeh[2] = CreateVehicle(405,-2297.7402,-288.5132,55.4661,215.4293,65,1,300); // San Fierro Rifa's members car
RifaVeh[3] = CreateVehicle(405,-2293.6931,-286.0263,54.6235,38.1339,65,1,300); // San Fierro Rifa's members car
RifaVeh[4] = CreateVehicle(405,-2320.3799,-303.3512,59.6196,208.7343,65,1,300); // San Fierro Rifa's members car

//OnPlayerStateChange
new modelid = GetVehicleModel(GetPlayerVehicleID(playerid));
if(newstate == PLAYER_STATE_DRIVER)
{
for(new n; n < sizeof(RifaVeh); n++)
		{
			if(GetPlayerVehicleID(playerid) == RifaVeh[n])
			{
			  if(!IsPlayerGangMember(playerid,Gang_Rifa))
			  {
			    RemovePlayerFromVehicle(playerid);
			    ErrorMsg(playerid,"Only San Fierro Rifa's Members!");
				}
				else SendFMessage(playerid,COLOR_SYSTEM,"You have entered %s's vehicle!",Gang_Rifa);
			}
		}
}
And If I spawn some vehicles in-game, I can enter these vehicles, so I think by spawning vehicles in-game RifaVeh's IDs changes don't they? Cause today I spawned a vehicle and it removed me and showed message Only San Fierro Rifa's Members! but it wasn't one of RifaVeh vehicles