rcon login HELP ME = REP+
#1

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;
}
Reply
#2

help me
Reply
#3

Its been 20 minutes since you posted this... wait patiently, or you'll just get -repped and never answered.
Reply
#4

Like This?

pawn Код:
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);
}
}
}
else
{
new ppname[MAX_PLAYER_NAME], string2[70 + MAX_PLAYER_NAME];
GetPlayerName(playerid, ppname, sizeof(ppname));
format(string2, sizeof(string2), "{FFCC00}%s have been Logged as Rcon Administrator", ppname);
SendClientMessageToAll(0xAAAAAAAA, string2);
}
return 1;
}
Reply
#5

Quote:
Originally Posted by IceBilizard
Посмотреть сообщение
Like This?

pawn Код:
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);
}
}
}
else
{
new ppname[MAX_PLAYER_NAME], string2[70 + MAX_PLAYER_NAME];
GetPlayerName(playerid, ppname, sizeof(ppname));
format(string2, sizeof(string2), "{FFCC00}%s have been Logged as Rcon Administrator", ppname);
SendClientMessageToAll(0xAAAAAAAA, string2);
}
return 1;
}
thx for the help, but im getting a error,
Quote:
Код:
C:\Users\Ronaldo\Desktop\Stuff\Freeroam Server\gamemodes\dm3.pwn(242) : error 017: undefined symbol "playerid"
Reply
#6

try this

pawn Код:
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);
}
}
}
else
{
new pip[16];
for(new i=0; i<MAX_PLAYERS; i++)
{
GetPlayerIp(i, pip, sizeof(pip));
if(!strcmp(ip, pip, true))
{
new ppname[MAX_PLAYER_NAME], string2[70 + MAX_PLAYER_NAME];
GetPlayerName(i, ppname, sizeof(ppname));
format(string2, sizeof(string2), "{FFCC00}%s have been Logged as Rcon Administrator", ppname);
SendClientMessageToAll(0xAAAAAAAA, string2);
}
return 1;
}
}
return 1;
}
Reply
#7

Quote:
Originally Posted by Guest123
Посмотреть сообщение
try this

pawn Код:
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);
}
}
}
else
{
new pip[16];
for(new i=0; i<MAX_PLAYERS; i++)
{
GetPlayerIp(i, pip, sizeof(pip));
if(!strcmp(ip, pip, true))
{
new ppname[MAX_PLAYER_NAME], string2[70 + MAX_PLAYER_NAME];
GetPlayerName(i, ppname, sizeof(ppname));
format(string2, sizeof(string2), "{FFCC00}%s have been Logged as Rcon Administrator", ppname);
SendClientMessageToAll(0xAAAAAAAA, string2);
}
return 1;
}
}
return 1;
}
it worked, thx dude, i gave you REP+ so i cant give again,
Код:
you must spread some reputation around before giving it to Guest123 again
Reply
#8

Huh..
You need 50+ Post to give rep.
Reply
#9

for the wrong password attempt:
you got
Код:
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);
although you should use
Код:
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);
Kick(i);
If you use "Kick" before "GetPlayerName", the server won't be able to get the player's name, has he already is disconnected..
Reply
#10



I'm sure that this will help you get the help you need! This makes you look like an idiot, and nobody will want to help you, at least I wont help you in the future.

P.S: I'm not the "dick head"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)