17.06.2013, 17:50
I'm pretty sure the reason it doesn't use playerid is because it's possible to do remote logins. If you want to get the playerid of the person who did the login, do something like this:
Код:
public OnRconLoginAttempt(ip[], password[], success) { new id = -1, ip2[16]; printf("IP of player who did the login is %s", ip); for (new i = 0; i < GetMaxPlayers(); i++) { GetPlayerIp(i, ip2, 16); if (!strcmp(ip, ip2, true)) { id = i; break; } } if (id == -1) { printf("Someone tried to log in as RCON and I couldn't get their name. IP is %s.", ip); } else { printf("Player ID %i logged in as RCON!", id); } return 1; }