13.02.2013, 15:16
pawn Код:
stock GetPlayerIdFromIp(ip[])
{
new pip[32], playerid;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1)
{
GetPlayerIp(i, pip, sizeof(pip));
if(!strcmp(ip, pip, true))
{
playerid = i;
break;
}
}
}
return playerid;
}
pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
new playerid;
playerid = GetPlayerIdFromIp(ip);
CallLocalFunction("OnRconLoginAttempEx", "dsb", playerid, password, success);
return 1;
}
pawn Код:
forward OnRconLoginAttempEx(playerid, password[], success);
public OnRconLoginAttempEx(playerid, password[], success)
{
if(!success)
{
//do code here
}
else GameTextForPlayer(playerid,"~g~WELCOME, ~r~ADMINISTRATOR!", 3000, 5);
return 1;
}