22.09.2017, 12:40
HELP guys other player typed wrong rcon password but server kicking me WTF
here is the code :
here is the code :
PHP код:
public OnRconLoginAttempt(ip[], password[], success)
{
if(success)
{
new pip[16];
for(new i = GetPlayerPoolSize(); i != -1; --i)
{
GetPlayerIp(i, pip, sizeof(pip));
if(!strcmp(ip, pip, true))
{
SetTimer("RconMsg", 1000, false);
}
}
}
else
{
SetTimer("KickPlayer", 1000, false);
}
return 1;
}
forward RconMsg(playerid);
public RconMsg(playerid)
{
new pname[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "{AFAFAF}%s {33CC33}has logged in as RCON Administrator", pname);
SendClientMessageToAll(COLOR_WHITE, string);
format(string, sizeof(string), "Welcome {AFAFAF}%s, {FFFFFF}Type {FF6600}/cmds {FFFFFF}to see Admin commands", pname);
SendClientMessage(playerid, COLOR_WHITE, string);
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
return 1;
}
forward KickPlayer(playerid);
public KickPlayer(playerid)
{
new pname[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "{AFAFAF}%s {FF0000}has tried to login in RCON and got Kicked!", pname);
SendClientMessageToAll(COLOR_RED, string);
for (new i = 0; i < MAX_PLAYERS; i++)
{
Kick(i);
}
return 1;
}