General > Developers Corner

ULX - SteamID to clipboard

(1/2) > >>

Snell:
This is my code
http://pastebin.com/1BviDHau
or

--- Code: ---function ulx.floop ( calling_ply, target_ply )

calling_ply:SetClipboardText ( target_ply:SteamID()  )
ulx.fancyLogAdmin( calling_ply, true, "#A copied the SteamID of #T", target_ply )

end
local floop = ulx.command ( CATEGORY_NAME, "ulx id", ulx.floop, "!id" )
floop:addParam{ type=ULib.cmds.PlayersArg }
floop:defaultAccess ( ULib.ACCESS_ALL )
floop:help ( "Copies target's SteamID" )

--- End code ---

I have tried a lot, with no success. The recurring error re guards the method "SteamID" being a Nil Value.

Decicus:
I believe I had a similar issue, just with a different code: http://forums.ulyssesmod.net/index.php/topic,6722.msg32743.html#msg32743

Try changing "PlayersArg" to "PlayerArg" on line 8 (according to the Pastebin).

Edit: I forgot to CTRL+V the post I was referring to...

JamminR:
ULib.cmds.PlayersArg returns a table of player objects, even if the table only has one object.
You'd have to cycle through it using for loop.
ULib.cmds.PlayerArg will only be one player object.

Snell:
This is what happened when I tested the Altered Code, I really have no idea what happened
http://i.imgur.com/04TsWMN.jpg

Cobalt:
SetClipboardText is a clientside function.

Navigation

[0] Message Index

[#] Next page

Go to full version