DARKRP money local?


                    g.draw.SimpleText("HP: "..g.LocalPlayer():Health(), "PlayerInfo", 30, total_y + 20, white, TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
                    g.draw.SimpleText("Armor: "..g.LocalPlayer():Armor(), "PlayerInfo", 30, total_y + 40, white, TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
                    g.draw.SimpleText("MONEY: "..g.LocalPlayer():?????(), "PlayerInfo", 30, total_y + 60, white, TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)

I want to make my own clientside HUD. But what is the name of the local of the money amount i have? & job? ( DARKRP )

LocalPlayer().DarkRPVars.money should work

[ERROR] lua/hud.lua:2906: attempt to call field ‘money’ (a number value)

  1. unknown - lua/hud.lua:2906

dont forget i’m running it client side

tostring the value.

Problems that don’t need their own thread ( All simple questions / quickies should go here ): http://forum.facepunch.com/showthread.php?t=1348923

DarkRP Help Thread ( ALL DarkRP Questions go here ): http://forum.facepunch.com/showthread.php?t=1249475

didnt get it

What do you mean, ‘didnt get it’…?

he didn’t tell me how to fix the error

Actually he kinda did. Like he said, tostring the value.



tostring( LocalPlayer().DarkRPVars.money )


Thanks, how can i make it separate by " , " because money show as 652526115 for example and not 652,526,115

Try this:



DarkRP.formatMoney( LocalPlayer().DarkRPVars.money )


attempt to index global ‘DarkRP’ (a nil value)

-snip-

its only for servers that allow sv_allowcslua and it contain things from GMOD lua wiki.

Why not see how it’s done in the DarkRP HUD?



LocalPlayer():getDarkRPVar("money")


still without ,

Sorry I forgot to include the format bit:



DarkRP.formatMoney(LocalPlayer():getDarkRPVar("money"))


function arguments expected near ‘.’

Don’t use tostring for this one, you don’t need it. You only needed it before because you were fetching the value differently. You also forgot a few parentheses. Try:



g.draw.SimpleText("MONEY: "..LocalPlayer():DarkRP.formatMoney(LocalPlayer():get DarkRPVar("money")), "PlayerInfo", 30, total_y + 60, white, TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)


attempt to index global ‘DarkRP’ (a nil value)



g.draw.SimpleText("MONEY: "..LocalPlayer():DarkRP.formatMoney(LocalPlayer():get DarkRPVar("money")), "PlayerInfo", 30, total_y + 60, white, TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)




"MONEY: "..LocalPlayer():DarkRP.formatMoney(LocalPlayer():get DarkRPVar("money")), "PlayerInfo", 30




formatMoney(LocalPlayer():get DarkRPVar("money"))




LocalPlayer():get DarkRPVar




get DarkRPVar