Este un plugin simplu, dar foarte eficient, care nu afectează cu nimic jucătorii reali, doar pe cei care încearcă să fure SteamID-ul cuiva de pe server, sau folosește SteamID Changer
Spoiler
#include <amxmodx>
#if !defined MAX_PLAYERS
const MAX_PLAYERS = 32;
#endif
#if !defined MAX_AUTHID_SIZE
const MAX_AUTHID_SIZE = 64;
#endif
new g_lastPlayerUserId[MAX_PLAYERS + 1] = {-1, ...};
public plugin_init() {
register_plugin("Check for duplicate AuthID", "1.0", "PRoSToC0der");
}
public client_authorized(playerEntIndex) {
static currentAuthID[MAX_AUTHID_SIZE];
currentAuthID = GetPlayerAuthID(playerEntIndex);
if (!ContainDigits(currentAuthID)) {
return;
}
new playerMaxCount = get_maxplayers();
for (new i = 1; i <= playerMaxCount; i++) {
if (!IsPlayerAuthorized(i)) {
continue;
}
if (equal(currentAuthID, GetPlayerAuthID(i))) {
server_cmd("kick #%d AuthID %s is already in use on this server", get_user_userid(playerEntIndex), currentAuthID);
return;
}
}
g_lastPlayerUserId[playerEntIndex] = get_user_userid(playerEntIndex);
}
public client_disconnect(playerEntIndex) {
g_lastPlayerUserId[playerEntIndex] = -1;
}
IsPlayerAuthorized(playerEntIndex) {
return g_lastPlayerUserId[playerEntIndex] != -1 && g_lastPlayerUserId[playerEntIndex] == get_user_userid(playerEntIndex);
}
GetPlayerAuthID(playerEntIndex) {
static authID[MAX_AUTHID_SIZE];
get_user_authid(playerEntIndex, authID, charsmax(authID));
return authID;
}
ContainDigits(const str[]) {
for (new i = 0; str[i] != EOS; i++) {
if (isdigit(str[i])) {
return true;
}
}
return false;
}