01.02.2014, 16:01
It can be done without the need of a continuing timer and an array. I wrote this:
and it works very well.
pawn Код:
#include <a_samp>
#include <foreach>
main() {}
public OnRconLoginAttempt(ip[], password[], success)
{
if (success) SetTimerEx("RetrieveRconPlayer", 1000, false, "s", ip);
return 1;
}
forward OnPlayerRconLogin(playerid);
public OnPlayerRconLogin(playerid)
{
printf("OnPlayerRconLogin -> playerid (%i) has been RCON logged in!", playerid);
return 1;
}
forward RetrieveRconPlayer(ip[]);
public RetrieveRconPlayer(ip[])
{
new
ip2[16];
foreach(new i : Player)
{
GetPlayerIp(i, ip2, 16);
if (!strcmp(ip, ip2) && IsPlayerAdmin(i))
{
CallRemoteFunction("OnPlayerRconLogin", "i", i);
}
}
return 1;
}