OnRconLoginAttempt - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnRconLoginAttempt (
/showthread.php?tid=444565)
OnRconLoginAttempt -
audriuxxx - 17.06.2013
Hi,
Why this callback don't have playerid?
Re: OnRconLoginAttempt -
[KHK]Khalid - 17.06.2013
It has a parameter for IP, you can get playerid from it just like the wiki example here -
https://sampwiki.blast.hk/wiki/OnRconLoginAttempt.
Re: OnRconLoginAttempt -
audriuxxx - 17.06.2013
Yes i knno that.. But it's possible this callback can get called, when player is not connected?
Re: OnRconLoginAttempt -
Sulps - 17.06.2013
No
This callback is called when someone tries to login to RCON, succesful or not.
And The Player Should be Connected :P
Re: OnRconLoginAttempt -
Alternative112 - 17.06.2013
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;
}