PDA

View Full Version : client serial


donrevan
01-29-2012, 13:39
I've a little question about client serials :o
so I wan't to do some storage buffer array like
new iStorage[client]=value;
i don't wan't to store the client id because it's not unique but either I don't wan't to use the steamid because it's a string.. so are client serials unique for each client even after reconnection?

Tylerst
01-29-2012, 14:06
I've a little question about client serials :o
so I wan't to do some storage buffer array like
new iStorage[client]=value;
i don't wan't to store the client id because it's not unique but either I don't wan't to use the steamid because it's a string.. so are client serials unique for each client even after reconnection?

If by serial you mean userid, then yes, they are unique per client.(For as long as the server is running) Just remember to translate it back into a client index before usage in sourcemod functions.

If you're talking about long term storage, as in even after server restarts, then steamid is the only way.

mcpan313
01-29-2012, 14:07
only STEAMID. try this:

new String:szStorage[MAXPLAYERS][32];

szStorage[client] = steamid;

Impact123
01-29-2012, 14:11
I tested this once with bots, while all bots where on the server and i left i kept my serial -144.
As soon as i kicked all bots i got the serial -155, so i would suggest something else.
You could write a function like: GetClientNumericSteamId and GetClientOfNumericSteamId.

Yours sincerely
Impact