How to display PS Points and get Steam name and Pic to display.

So I am wondering how I can make my HUD display the amount of points you have from _Undefined’s PointShop? I am also wondering how I can get my HUD to display your Steam Name and Steam Profile Picture? I HAVE googled it so please DO NOT say google it :\ I really hate it when people say that. I have also been working around this for the past 2 hours and I still have no success… One more thing, I have looked into the addons lua files and I couldn’t find anything that would allow me to display points.

Thank you for any help :slight_smile:

-Bradley

Get the player’s name and draw it. Do the same for points. Use an avatar image and set the player to the LocalPlayer

But how would I get the points and the name? What do I have to call to get it to work? (Im terribly sorry for my lack of LUA knowledge).

It’s Lua. Not LUA.

Two, I’m going to say it. It’s not hard to google. If you don’t find it, change your search terms. Look in the pointshop GitHub for how they get points. Same goes for drawing an avatar.

For the profile pic use


local function DrawPlayerAvatar( p )
	av = vgui.Create("AvatarImage")
	av:SetPos(85,ScrH() - 973)
	av:SetSize(59, 59)
	av:SetPlayer( p, 64 )
end

And for the name use LocalPlayer():Name()

I can’t understand why nookyava gave you dumb rate…It’s that him doesn’t know that :Name() works like :Nick()?

[lua]
Server cvar ‘sv_allowcslua’ changed to 1
] lua_run_cl MsgN(LocalPlayer():Name()," “,LocalPlayer().Name,” ",LocalPlayer():Nick())
Gonzalolog function: 0x2897fbc8 Gonzalolog
[/lua]

That grammar was terrible.

And I rated him dumb because of my own reasons. I know very well that both of those work, so don’t assume.

-snip-

I think one of the first steps to becoming a decent Lua coder is having the ability to take the time to research and think about things.

Spend a moment looking through cl_player_extension.lua, not only will it help you with this question, but possibly other ones in future, since it’s very simple to read and extremely helpful if working with PS stuff.

I figured out to display the steam avatar and name but I looked on the GitHub page and found nothing at all about displaying the amount of points you have…

Thank you all for your help (and rude comments xP)! Now, I have another problem. I want my friend to join my game and test it with me, but, when he joins, the HUD isn’t showing up for him…

Make sure you AddCSLuaFile’d it. If you AddCSLuaFile a shared file, you don’t need to put an argument if it’s in the file you’re trying to send to the client.

If you are trying to send the client a client-only script, then the server needs to use AddCSLuaFile somewhere.

Alternatively, you can put your Lua into addons/your_addon_name/lua/autorun/client/ and it’ll be included automatically.

Excuse me? Gringo?

Okay, please don’t use my HELP post as a place to flame each other on.

Since you’re probably going to be needing more help in the future, for the record this happens on 80-90% of the help threads.

It’s probably because he didn’t localize the new panel he just created, but you also didn’t notice.