[Help] Public IsAPlane - 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: [Help] Public IsAPlane (
/showthread.php?tid=150941)
[Help] Public IsAPlane -
Rosco_Rich - 28.05.2010
I constantly update my server and add cars to it. Well, for faction reasons I have it set which car belongs to which faction. Example:
public IsAPlane(carid)
{
if(carid == 38 || carid == 55 || carid == 73 || carid == 168 || (carid >= 476) && (carid <= 480) || (carid >= 494) && (carid <= 500) || (carid == 505) || (carid >= 359) && (carid <= 363) || (carid == 365) || (carid == 369))
{
return 1;
}
return 0;
}
Well, when I add new cars it gives it an ID and it throws everything out of balance. Is it possible to use some other method instead of using the car ID's?
Re: [Help] Public IsAPlane -
DeathOnaStick - 28.05.2010
Other methods like what? Give an example how you would like it to be, pls.
Re: [Help] Public IsAPlane -
LTomi - 28.05.2010
It is more easier if you check the model of the vehicle instead of it's ID, but it only works if you don't care about that the vehicle is the property of a faction or not. For example, this script returns 1 if you are in a plane and it returns 0 if you are not in one. If you want to check if a vehicle belongs to a faction, you have to do it with the vehicle IDs.
pawn Код:
public IsAPlane(carid)
{
if(GetVehicleModel(carid) == 592 || GetVehicleModel(carid) == 577 || GetVehicleModel(carid) == 511 || GetVehicleModel(carid) == 512 || GetVehicleModel(carid) == 593 || GetVehicleModel(carid) == 520 || GetVehicleModel(carid) == 553 || GetVehicleModel(carid) == 476 || GetVehicleModel(carid) == 519 || GetVehicleModel(carid) == 460 || GetVehicleModel(carid) == 513)
{
return 1;
}
return 0;
}
Re: [Help] Public IsAPlane -
Rosco_Rich - 28.05.2010
Oh, doing it by the model will be so much easier. Thank you.