GMod Autodonations - rp_setmoney

Just before you all go “you so newb pls gtfo never make server” I’m not the “developer” of the server, but just experimenting.

I’m trying to add so you get money when you autodonate, ive made it add you to a group, but cant seem to make it add money.
Heres what i’m trying.



RunConsoleCommand( "ulx", "adduserid", "" .. ply:SteamID() .. "", "bronze donator")
RunConsoleCommand("rp_setmoney", "bobby", "100");


I used bobby (my rp name) just to see if it worked when hardcoded… it didnt.

If anyone could point me in the right direction id be grateful.

Were you on the server when you did this?

If you aren’t on the server, you’d have to set the money in the database.

This is running through a lua command, its done when the person logins to the server, the donator bit works so, so should the money but it doesn’t.

That might not be thee case. The player does not have to be on the server to ulx adduserid.

the ulx works, the money doesnt.

Could be due to something else. Any errors in the console?

rp_setmoney sets your money rather than adding to it. To make it add instead of setting then you need to give it a third argument telling it whether to add or subtract:

[lua]RunConsoleCommand(“rp_setmoney”, “bobby”, “100”, “+”)[/lua]

RunConsoleCommand: Command has invalid characters! (rp_setmoney (’ '))

The code atm:

[LUA]
RunConsoleCommand( “ulx”, “adduserid”, “” … ply:SteamID() … “”, “bronze donator”)
RunConsoleCommand(“rp_setmoney”, “bobby”, “100”, “+”)
[/LUA]

You cannot have spaces in the arguments: “bronze donator”

Make it “bronze”, “donator”

the bronze donator thing works, the money doesnt.

I’m not entirely sure that you should be using your RP name as the Arg there. Try your steam name or group.

It can be user ID, Steam ID, Steam name or RP name.


Either way, it seems RunConsoleCommand hates “+” as an argument. Since you are doing this in Lua, I recommend just straight up calling DarkRP’s addMoney function.

[lua]
ply:addMoney(100)
[/lua]

Why dont you use steam id?İ think it will be better since there will be minges screwing around with it