(http://i.imgur.com/kXYRjnI.png)
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.
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.
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
@KAKAN He didn't meant that, he means how can he put someone in a custom vehicle.
Like any other car. Spawn it, then use FindVehicle, then set player.Vehicle to that.
What I did was, added custom car but never spawned it.
And tried to set player as driver!
Thanks.