Pointshop - UniqueID Storage -> SteamID Storage

Hey, I’m sure someone could tell me how to do this!

I’m using Pointshop on my servers and have them connected to a MySQL database. As you probably know, each user is given a UniqueID which is associated with their amount of points and items etc. Would anybody know how to change the storage method from UniqueID to SteamID (would Steam64 ID work better?)? It would be alot easier for quite a few things I would like to implement.

To clarify: I am not looking to convert UniqueID to SteamID, rather change the storage method from UniqueID to SteamID, if you understand what I mean.

Thanks!

in providers/mysql.lua change line 91 to read:

[lua]local q = db:query(“INSERT INTO pointshop_data (uniqueid, points, items) VALUES (’” … ply:SteamID64() … “’, '” … (points or 0) … “’, '” … db:escape(util.TableToJSON(items or {})) … “’) ON DUPLICATE KEY UPDATE points = VALUES(points), items = VALUES(items)”)[/lua]

You can change your uniqueid to BIGINT datatype.

Wow, thanks a bunch! It worked perfectly. The only thing, the
[lua]local q = db:query(“INSERT INTO pointshop_data (uniqueid, points, items) VALUES (’” … ply:SteamID64() … “’, '” … (points or 0) … “’, '” … db:escape(util.TableToJSON(items or {})) … “’) ON DUPLICATE KEY UPDATE points = VALUES(points), items = VALUES(items)”)[/lua]
that you said was on line 91 was actually on line 181 for me. Just letting anybody else know who may need this question answered!

It shouldn’t be, are you not using the official mysql provider? https://github.com/adamdburton/pointshop-mysql

I believe I am? Either that or I’m using an older version. Meh, it works anyway so I’ll not mess with anything lol

Thanks again :slight_smile:

[editline]27th December 2013[/editline]

One other thing, is it possible to add the players name to the table?