forward KickPlayer();
public KickPlayer()
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
new pname[MAX_PLAYER_NAME], string[128];
GetPlayerName(i, pname, sizeof(pname));
format(string, sizeof(string), "{AFAFAF}%s {FF0000}has tried to login in RCON and got Kicked!", pname);
SendClientMessageToAll(COLOR_RED, string);
Kick(i);
}
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); Kick(playerid); return 1; }
KickPlayer();
KickPlayer(playerid);
//You must pass the id of player you want to kick forward KickPlayer(playerid); public KickPlayer(playerid) { //Here you get the name of player to kick 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); //Kick the player Kick(playerid); for (new i = 0; i < MAX_PLAYERS; i++) { //And than send the message to all connected players if(IsPlayerConnected(i)) SendClientMessageToAll(COLOR_RED, string); } return 1; }
Код:
//You must pass the id of player you want to kick forward KickPlayer(playerid); public KickPlayer(playerid) { //Here you get the name of player to kick 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); //Kick the player Kick(playerid); for (new i = 0; i < MAX_PLAYERS; i++) { //And than send the message to all connected players if(IsPlayerConnected(i)) SendClientMessageToAll(COLOR_RED, string); } return 1; } |
EDITED :
my brother typed wrong rcon password but server kicking me not him LOL |
When you call this function you must pass the ID of your brother not your.
|
Код:
//You must pass the id of player you want to kick forward KickPlayer(playerid); public KickPlayer(playerid) { //Here you get the name of player to kick 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); //Kick the player Kick(playerid); for (new i = 0; i < MAX_PLAYERS; i++) { //And than send the message to all connected players if(IsPlayerConnected(i)) SendClientMessageToAll(COLOR_RED, string); } return 1; } |
for (new i = 0; i < MAX_PLAYERS; i++)
{
//And than send the message to all connected players
if(IsPlayerConnected(i)) SendClientMessageToAll(COLOR_RED, string);
}
public OnRconLoginAttempt(ip[], password[], success) { if(!success) { for(new i; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { new pip[200]; GetPlayerIp(i, pip, sizeof(pip)); if(strcmp(ip, pip, true, 200)) { KickPlayer(i); } } return 1; } } 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); Kick(playerid); return 1; }
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;
}
HELP guys other player typed wrong rcon password but server kicking me WTF
|