Hello to whomever it may concern,
I have here an addon for an F3 menu, and i'm hoping to make it so that SDonate can be used to add a certain amount of credits to the user's credit amount. The only way I can see to do that, is by using a cvar. Now, I used the ulx addcredits command, but this would only work with the player's nickname in that server, and SDonate can only output steam names and Steam IDs.
So, what I planned to do was either make a new command just for doing the same thing with the ID, or to make the current one there compatible with Steam IDs.
If anybody could help me out, it'd be much much appreciated. I'm brand new to Ulysses, and still fairly new to Lua coding with only having a few addons i've made.
Current AddCredits command code:
function ulx.addCredits( calling_ply, target_ply, amount )
if( type( amount ) != "number" ) then
calling_ply:ChatPrint( "Invalid amount! Only a number." );
return;
end
ML:AddCredits( target_ply, amount );
ulx.fancyLogAdmin( calling_ply, "#A gave #T #i credits", target_ply, amount );
end
local addCredits = ulx.command( CATEGORY_NAME, "ulx addcredits", ulx.addCredits, "!addcredits" )
addCredits:addParam{ type=ULib.cmds.PlayerArg };
addCredits:addParam{ type=ULib.cmds.NumArg, hint="credits" };
addCredits:defaultAccess( ULib.ACCESS_ADMIN );
addCredits:help( "Add to the F3 credits of a user(you can use negative amounts like -100)." );