SA-MP Forums Archive
rcon login HELP ME = REP+ - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: rcon login HELP ME = REP+ (/showthread.php?tid=443324)



rcon login HELP ME = REP+ - InTeL_cOrE_i7 - 11.06.2013

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;
}


Re: rcon login HELP ME = REP+ - InTeL_cOrE_i7 - 11.06.2013

help me


Re: rcon login HELP ME = REP+ - Max_Coldheart - 11.06.2013

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


Re: rcon login HELP ME = REP+ - IceBilizard - 11.06.2013

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;
}



Re: rcon login HELP ME = REP+ - InTeL_cOrE_i7 - 11.06.2013

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"



Re: rcon login HELP ME = REP+ - Guest123 - 11.06.2013

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;
}



Re: rcon login HELP ME = REP+ - InTeL_cOrE_i7 - 11.06.2013

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



Re: rcon login HELP ME = REP+ - Avi57 - 11.06.2013

Huh..
You need 50+ Post to give rep.


Re: rcon login HELP ME = REP+ - Sascha - 11.06.2013

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..


Re: rcon login HELP ME = REP+ - Max_Coldheart - 12.06.2013



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"