Jump to content

HELP Custom Car Names


Recommended Posts

Posted

Well there you are doing something wrong if you want "carname[model]" to actually do something since its just a key value/string being search for, not any table position thought.

My ingame nick is ~HyPeX~

BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager

gKhdyRJ.png

Posted

Yeah, I know that though. That was just what I've tried to do.

Need help with something? Message me, and maybe I'll get back to you. And might even do it for a fair price.

  • Moderators
Posted

how did you saved this element data?

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted

The carnames, I saved those in a server sided script.

That's what I use to let the carname show when I enter the car *Thanks to MrTasty*

.. tostring(carname[getElementModel(source)][1]) .. 

Need help with something? Message me, and maybe I'll get back to you. And might even do it for a fair price.

Posted
That did work!

I got another problem

table.insert(content, {"   -  " ..(getElementData(source, "carname[model]") or getVehicleNameFromModel( getElementModel( source ) ))} ) 

I've tried some options neither did they work. I actually want the custom carname to show instead of the mta model

Aren't you just trying to take out the value from the table? No point of getElementData.

I'm pretty sure this'll work:

table.insert(content,{ "  -  " ..(carname[getElementModel(source)] or getVehicleNameFromModel(getElementModel(source)))}) 

But what exactly are you trying to do by putting the custom name into a table?

Previously known as MrTasty.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...