11.06.2013, 15:42
what i want to do it when a player logs in as rcon admin successfully, to send all players a message and to him...
This is what i got so far...this is when player enters wrong rcon password, now i want, when player logs in successfully, to send every one a message
public OnRconLoginAttempt(ip[], password[], success)
{
if(!success)
{
printf("FAILED RCON LOGIN BY IP: %s USING PASSWORD: %s",ip, password);
new pip[16];
for(new i=0; i<MAX_PLAYERS; i++)
{
GetPlayerIp(i, pip, sizeof(pip));
if(!strcmp(ip, pip, true))
{
SendClientMessage(i, 0xFFFFFFFF, "{FF0000}>>KICK: {FFCC00}You have been {FF6600}Kicked {FFCC00}from the server, {FF6600}REASON: {FFCC00}Failed Rcon Login.");
Kick(i);
new pname[MAX_PLAYER_NAME], string[70 + MAX_PLAYER_NAME];
GetPlayerName(i, pname, sizeof(pname));
format(string, sizeof(string), "{FF0000}>>KICK: {FFCC00}%s have been {FF6600}Kicked {FFCC00}from the server, {FF6600}REASON: {FFCC00}Failed Rcon Login.", pname);
SendClientMessageToAll(0xAAAAAAAA, string);
}
}
}
return 1;
}
This is what i got so far...this is when player enters wrong rcon password, now i want, when player logs in successfully, to send every one a message
public OnRconLoginAttempt(ip[], password[], success)
{
if(!success)
{
printf("FAILED RCON LOGIN BY IP: %s USING PASSWORD: %s",ip, password);
new pip[16];
for(new i=0; i<MAX_PLAYERS; i++)
{
GetPlayerIp(i, pip, sizeof(pip));
if(!strcmp(ip, pip, true))
{
SendClientMessage(i, 0xFFFFFFFF, "{FF0000}>>KICK: {FFCC00}You have been {FF6600}Kicked {FFCC00}from the server, {FF6600}REASON: {FFCC00}Failed Rcon Login.");
Kick(i);
new pname[MAX_PLAYER_NAME], string[70 + MAX_PLAYER_NAME];
GetPlayerName(i, pname, sizeof(pname));
format(string, sizeof(string), "{FF0000}>>KICK: {FFCC00}%s have been {FF6600}Kicked {FFCC00}from the server, {FF6600}REASON: {FFCC00}Failed Rcon Login.", pname);
SendClientMessageToAll(0xAAAAAAAA, string);
}
}
}
return 1;
}