ULX command to give point via steam id

I am aware of this:

But it does not seem to function properly.

Would be really great if anyone could help in making a ulx command just to give points via their steam id.

concommand.Add( "givepoints", function( ply, cmd, args )
   if ( not ply:IsAdmin() ) then return end
   local GiveString = ply:Nick() .. " gave you " .. args[ 2 ] .. " points!"
   args[ 1 ]:PS_GivePoints( args[ 2 ], GiveString )
end )

Will this work when using a players steamid though?

It should, but I haven’t tested it.

I’ll test in just a sec and report back!

[editline]17th August 2014[/editline]

seems like steamid wont work :confused:

[editline]17th August 2014[/editline]

I tried this:

but it did not work :confused:

Any errors in the console, if on dedi, server console?

nope, just can’t target the steamid, the givepoints will work when chosen from the player in the ulx menu or if the nick is typed (even the short name like !givepoints Judd even though my in game name is Dr. Judd)

When inputting the command, try wrapping the Steam ID in quotes.
For example…
ulx givepoints “STEAM_0:0:16790507”

no targets found

It’s not the ULX’s fault, it’s PS_GivePoints that is failing (in some way).
You are basically passing string to a funciton that has entity as it’s argument and meta.

net.Receive('PS_GivePoints', function(length, ply)

function Player:PS_GivePoints(points)

What you have to do is modify PS_GivePoints so it checks inside the database for SteamID entries (altho it uses UniqueID I believe) and then add points to it.

[editline]18th August 2014[/editline]

I am assuming you want to give points to people who aren’t currently on the server, if so then the above post applies to that, otherwise you gotta run a loop and compare players steam ids to the one provided and then pass it to PS_GivePoints

Yea, that’s exactly what I’m trying to accomplish. I’m very novice with this stuff, trying to learn but what exactly would I do with that?

Well, depending on which database do you use (txt/sql) you gotta get it’s structure or filename.
By structure I meant stuff like - in which column are the points mentioned, which did Adam use to store players (uniqueID or steamID).

Now that you know that stuff, I suggest creating a new function called PS_GivePointsToOffline() or anything as easy for you to remember and access.
All you have to do inside that function now is:
-check if there is entry of the player with such uID or sID in the databse
-if there is then get his points from database, increase it by N amount and save the entry

Easy as that.