*.Vehicle returns something else.

Started by rObInX, Aug 30, 2015, 12:37 PM

Previous topic - Next topic

rObInX


player.Vehicle returns some instance.
Is there any mistake from my side, in the execution?

Regards,
rObInX

.

You're printing the address in memory where the vehicle instance is located. I can also notice that you're on a x64 bit system. Try plr.Vehicle.ID if that's what you want.
.

rObInX

#2
Thanks for the help.
Fixed btw.

<rObInX> !exec local plr = FindPlayer(0); AMessage( plr.Name + " " + GetVehicleNameFromModel( plr.Vehicle.Model ) );
P.S How can I set a player into a custom car?
I can't find it using FindVehicle.

KAKAN

Use this(edit it 1st)
if (GetVehicleNameFromModel(vehicle.Model)== null ) MessagePlayer(">> [#FF0000]Entering in [#FFFFFF]"+GetVehicleNameFromCustomModel(vehicle.Model)+".",player);
else MessagePlayer(">> [#FF0000]Entering In [#FFFFFF]"+GetVehicleNameFromModel(vehicle.Model)+".",player);

Now function:-
function GetVehicleNameFromCustomModel(model)
{
switch(model)
{
case 6400: return "1st one"; /1st car name, edit the others too
case 6401: return "2nd one";
case 6402: return "3rd one";
case 6403: return "4th one"; //Add how many u want
default: return "Name not specified";
}
}

Credits:- @Bezstone
oh no

Xmair

@KAKAN He didn't meant that, he means how can he put someone in a custom vehicle.

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

Thijn

Like any other car. Spawn it, then use FindVehicle, then set player.Vehicle to that.

rObInX

What I did was, added custom car but never spawned it.
And tried to set player as driver!

Thanks.