Need help with specific vehicle models - 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)
+--- Thread: Need help with specific vehicle models (
/showthread.php?tid=304869)
Need help with specific vehicle models -
milanosie - 20.12.2011
hello there. Is there anyway I can make my script work only if the player is sitting a in one out of 5 specific vehicle models?
I know this can be done by adding staticvehicles and using their Id but when people buy cars at my server the ID's change so that wont work I guess..
Any help?
Re: Need help with specific vehicle models -
Vince - 20.12.2011
GetVehicleModel will help you.
This forum requires that you wait 120 seconds between posts. Please try again in 1 seconds. Seriously?
Re: Need help with specific vehicle models -
[ABK]Antonio - 20.12.2011
Well, you can define their vehicles as a specific ID like,
at the top...
then where ever
pawn Код:
VEH = CreateVehicle(blah);
Then
pawn Код:
if(GetPlayerVehicleID(playerid) == VEH)
if that's what you want
Re: Need help with specific vehicle models -
Hoborific - 20.12.2011
I wrote something a very long time ago similar to this, here it is.
pawn Код:
stock IsCarTruck(playerid)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 514 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 403
|| GetVehicleModel(GetPlayerVehicleID(playerid)) == 515)
{
return true;
}
return false;
}