SA-MP Forums Archive
Is that right? - 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: Is that right? (/showthread.php?tid=66796)



Is that right? - G-KilLa - 24.02.2009

I script my own RealLife now...
I need a code for defines the vehicles
also motobikes, boats, bikes, and planes is that right?
Код:
public IstEinFahrrad(carid) //Bike
{
	new fahrrad = GetVehicleModel(carid);
	if(fahrrad==509||fahrrad==481||fahrrad==510)
	{
		return 1;
	}
	return 0;
}
public IstEinRoller(carid) //Motoroller
{
	new roller = GetVehicleModel(carid);
	if(roller==462||roller==448)
	{
		return 1;
	}
	return 0;
}
public IstEinQuad(carid) //Quad
{
	new quad = GetVehicleModel(carid);
	if(quad==471)
	{
		return 1;
	}
	return 0;
}
public IstEinMotorad(carid) //Motorbike
{
	new motorad = GetVehicleModel(carid);
	if(motorad==581||motorad==521||motorad==463||motorad==522||motorad==461||motorad==468||motorad==586)
	{
		return 1;
	}
	return 0;
}
public IstEinFlugzeug(carid) //Plane
{
	new flugzeug = GetVehicleModel(carid);
	if(flugzeug==592||flugzeug==577||flugzeug==511||flugzeug==512||flugzeug==593||flugzeug==520||flugzeug==553||flugzeug==476||flugzeug==519||flugzeug==460||flugzeug==513)
	{
		return 1;
	}
	return 0;
}
public IstEinHelikopter(carid) //Helikopter
{
	new helikopter = GetVehicleModel(carid);
	if(helikopter==548||helikopter==425||helikopter==417||helikopter==487||helikopter==488||helikopter==497||helikopter==563||helikopter==447||helikopter==469)
	{
		return 1;
	}
	return 0;
}
public IstEinBoot(carid) //Boat
{
	new boot = GetVehicleModel(carid);
	if(boot==472||boot==473||boot==493||boot==595||boot==484||boot==430||boot==453||boot==452||boot==446||boot==454)
	{
		return 1;
	}
	return 0;
}
public IstEinAuto(carid) //Car
{
	new fahrrad = CallLocalFunction("IstEinFahrrad","i");
	new roller = CallLocalFunction("IstEinRoller","i");
	new quad = CallLocalFunction("IstEinQuad","i");
	new motorad = CallLocalFunction("IstEinMotorad","i");
	new flugzeug = CallLocalFunction("IstEinFlugzeug","i");
	new helikopter = CallLocalFunction("IstEinHelikopter","i");
	new boot = CallLocalFunction("IstEinBoot","i");
	if(!boot && !helikopter && !flugzeug && !quad && !motorad && !roller && !fahrrad)
	{
		return 1;
	}
	return 0;
}
sorry but the public functions are german and sorry for my bad english iam come from germany


Re: Is that right? - brett7 - 24.02.2009

i think you have to use stock instead of public because you are defining it


Re: Is that right? - G-KilLa - 24.02.2009

what for a stock?can you please give a example?


Re: Is that right? - G-KilLa - 24.02.2009

can anyone else help?


Re: Is that right? - brett7 - 24.02.2009

heres an example by andre9977
pawn Код:
stock IsBike(carid)
{
  new Bikes[] = { 509, 481, 510 };
  for(new i = 0; i < sizeof(Bikes); i++)
  {
    if(GetVehicleModel(carid) == Bikes[i]) return 1;
  }
  return 0;
}
hope this helps and don't double post please


Re: Is that right? - G-KilLa - 25.02.2009

Hi!
A Big THX for this Code but
I'm looking for exactly that all the car's ID defined but on the contrary, so all I Motorbikes, boats and so on, and then define only the contrary can also "else(" If you understand what I mean...
I need something like:
Код:
public IstEinAuto(carid)
{
	new fahrrad = CallLocalFunction("IstEinFahrrad","i");
	new roller = CallLocalFunction("IstEinRoller","i");
	new quad = CallLocalFunction("IstEinQuad","i");
	new motorad = CallLocalFunction("IstEinMotorad","i");
	new flugzeug = CallLocalFunction("IstEinFlugzeug","i");
	new helikopter = CallLocalFunction("IstEinHelikopter","i");
	new boot = CallLocalFunction("IstEinBoot","i");
	if(!boot && !helikopter && !flugzeug && !quad && !motorad && !roller && !fahrrad)
	{
		return 1;
	}
	return 0;
}
ok?


Re: Is that right? - G-KilLa - 26.02.2009

nobody has a solution?


Re: Is that right? - G-KilLa - 26.02.2009

here this is my solution
Код:
stock IstEinAuto(carid)
{
	if(!IstEinFahrrad(carid) && !IstEinMotorroller(carid) && !IstEinQuad(carid) && !IstEinMotorad(carid) && !IstEinBoot(carid) && !IstEinHelikopter(carid) && !IstEinFlugzeug(carid))
	{
		return 1;
	}
  return 0;
}
is that right?


Re: Is that right? - Marcel - 26.02.2009

Try to find out.