Author Topic: give points to user by steamid or in game  (Read 2220 times)

0 Members and 1 Guest are viewing this topic.

Offline frustratedgamers

  • Newbie
  • *
  • Posts: 36
  • Karma: -1
give points to user by steamid or in game
« on: August 15, 2014, 10:41:53 AM »
I'm aware of this:
http://forums.ulyssesmod.net/index.php?topic=7101.0

But it does not seem to work really.

If anyone know how if possible to make a command that will allow you to give points to a user using their steam ID or in game name that would be amazing!

Offline frustratedgamers

  • Newbie
  • *
  • Posts: 36
  • Karma: -1
Re: give points to user by steamid or in game
« Reply #1 on: August 17, 2014, 04:31:55 PM »
Would this work:
Code: [Select]
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 )

Offline frustratedgamers

  • Newbie
  • *
  • Posts: 36
  • Karma: -1
Re: give points to user by steamid or in game
« Reply #2 on: August 30, 2014, 01:20:33 AM »
still looking for an option for this

Offline Avoid

  • Full Member
  • ***
  • Posts: 142
  • Karma: 42
Re: give points to user by steamid or in game
« Reply #3 on: September 02, 2014, 04:30:47 PM »
Hello,
since we are in the Ulysses forums, I assume you want an ULX command rather than an actual concommand..right?

Code: [Select]
function ulx.givepoints( calling_ply, target_ply, points )

target_ply:PS_GivePoints(points)
        ulx.fancyLogAdmin( calling_ply, "#A gave #i points to #T", points, target_ply )

end
local givepoints = ulx.command( "Utility", "ulx givepoints", ulx.givepoints, "!givepoints" )
givepoints:defaultAccess( ULib.ACCESS_ADMIN )
givepoints:addParam{ type=ULib.cmds.PlayerArg }
givepoints:addParam{ type=ULib.cmds.NumArg, min=1, max=10000, default=100, hint="points", ULib.cmds.optional, ULib.cmds.round }
givepoints:help( "Give points for PS to players" )

Also, pointshop already comes with an admin panel to give out points to players.