Veh Id Question - 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: Veh Id Question (
/showthread.php?tid=183146)
Veh Id Question -
[UG]Scripter - 14.10.2010
Okay,
I forgot one of the most basic things I ever learnt. How to get a specific Vehicle ID.
So if I was to make a vehicle lock system, I can lock a specific vehicle. Not the Model, The actually vehicle.
Say Vehicle 15 in the script is a Police Mavrick. I forgot how to tell the script to lock that specific vehicle ID...
Can someone refresh my memory please.
Re: Veh Id Question -
CrucixTM - 14.10.2010
pawn Код:
new pol_maverick;
pol_maverick = CreateVehicle(lalalalala)
SetVehicleParamsForPlayer(playerid, pol_maverick, blabla)
Did that help :P
Note, I'm not sure how to use the VehicleParams thing, but. Well.
Re: Veh Id Question -
[UG]Scripter - 14.10.2010
Quote:
Originally Posted by CrucixTM
pawn Код:
new pol_maverick;
pol_maverick = CreateVehicle(lalalalala)
SetVehicleParamsForPlayer(playerid, pol_maverick, blabla)
Did that help :P
Note, I'm not sure how to use the VehicleParams thing, but. Well.
|
Sort of..
I was thinking of something like
if(vehicleid[playerid] == 15)
Idc if it doesn't look good along as it gives the general Idea its all good.
Re: Veh Id Question -
Niixie - 14.10.2010
Well, you can make a var. to store if the player has one vehicle locked.
so do
pawn Код:
new PlayerVehicleLocked[MAX_PLAYERS];
So, when you want to use it, you can do as you did
pawn Код:
if(PlayerVehicleLocked[playerid] == 15)
Re: Veh Id Question -
SkizzoTrick - 14.10.2010
lemme give you a command /oldcar
it's the most simplest way to find a vehicle id
Quote:
if(strcmp(cmd, "/oldcar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new string[35];
format(string, sizeof(string), "Your old car was: %d",LastVehicle[playerid]);
SendClientMessage(playerid, COLOR_ORANGE, string);
}
return 1;
}
|
but you need to have/create the function named LastVehicle
If you don't have it,lemme do it for you
Quote:
new LastVehicle[MAX_PLAYERS];
|
under OnPlayerEnterVehicle
Quote:
LastVehicle[playerid] = vehicleid;
|