25.12.2011, 09:19
Quote:
Hey guys i'm stuck with my code because OnRconLoginAttempt is not working in 0.3d . It used to work on 0.3c!
Here is the code for my OnRconLoginAttempt: Код:
public OnRconLoginAttempt(ip[], password[], success) { if(!success) { new pname[MAX_PLAYER_NAME]; new string[128]; new stradm[128]; new pip[16]; for(new i=0; i<MAX_PLAYERS; i++) { GetPlayerIp(i, pip, sizeof(pip)); if(!strcmp(ip, pip, true)) { GetPlayerName(i, pname, sizeof(pname)); format(stradm, sizeof(stradm), "Player \"%s\" [IP: %s] failed RCON login by using password [%s]. ",GetName(i),ip, password); SendClientMessageToAdmins(0xFF0000AA,stradm,5); format(string, sizeof(string), "[KICK] %s has failed the RCON password.", pname); SendClientMessageToAll(COLOR_RED,string); PlayerDisconect(i); Kick(i); } } } return 1; } |
pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
if(!success)
{
new pname[MAX_PLAYER_NAME];
new string[128];
new stradm[128];
new pip[16];
for(new i=0; i<MAX_PLAYERS; i++)
{
GetPlayerIp(i, pip, sizeof(pip));
if(!strcmp(ip, pip, true))
{
GetPlayerName(i, pname, sizeof(pname));
format(stradm, sizeof(stradm), "Player \"%s\" [IP: %s] failed RCON login by using password [%s]. ",pname(i),ip, password);
SendClientMessageToAdmins(0xFF0000AA,stradm,5);
format(string, sizeof(string), "[KICK] %s has failed the RCON password.", pname(i));
SendClientMessageToAll(COLOR_RED,string);
Kick(i);
}
}
}
return 1;
}