This topic was marked solved by its starter, on August 30th, 2015, 05:58 PM
*.Vehicle returns something else.

rObInX

  • Jr. Member
  • Posts: 67
*.Vehicle returns something else.
« on August 30th, 2015, 01:37 PM »Last edited on August 30th, 2015, 01:46 PM

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

Regards,
rObInX

.

  • VC:MP Beta Tester
  • .
  • Posts: 1,804
Re: *.Vehicle returns something else.
« Reply #1, on August 30th, 2015, 01:41 PM »
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

  • Jr. Member
  • Posts: 67
Re: *.Vehicle returns something else.
« Reply #2, on August 30th, 2015, 01:45 PM »Last edited on August 30th, 2015, 02:00 PM
Thanks for the help.
Fixed btw.

Code: [Select]
<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

  • Wiki Contributor
  • Posts: 3,346
Re: *.Vehicle returns something else.
« Reply #3, on August 30th, 2015, 02:24 PM »
Use this(edit it 1st)
Code: [Select]
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:-
Code: [Select]
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
You can contact me using Discord, at Developers.CPP( check off-board to find the invite link )
Github: https://github.com/theKAKAN

Xmair

  • Wiki Contributor
  • Posts: 879
VU Full Member | VCCNR Developer | KTB Developer | EAD Ex-Scripter

Thijn

  • VC:MP Beta Tester
  • Posts: 1,689

rObInX

  • Jr. Member
  • Posts: 67