Veh Id Question
#1

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.
Reply
#2

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.
Reply
#3

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.
Reply
#4

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)
Reply
#5

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;

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)