public OnRconLoginAttempt(ip[], password[], success)
{
if(success)
{
//Pegar ID
new pip[25],LoggedID = INVALID_PLAYER_ID;
for(new i=0; i<MAX_PLAYERS; i++)
{
GetPlayerIp(i, pip, sizeof(pip));
if(!strcmp(pip, ip))
{
LoggedID = i;
break;
}
}
//Nome
new ADMNAME[MAX_PLAYER_NAME];
if(LoggedID != INVALID_PLAYER_ID)
GetPlayerName(LoggedID, ADMNAME, MAX_PLAYER_NAME);
else
ADMNAME = "[Login remoto]";
//Salvar em LOG
new logstring[128];
format(logstring, sizeof(logstring), "%s - %s - logou-se com sucesso na RCON.", ADMNAME,ip);
SaveToFile("RCONLogins",logstring);
}
return 1;
}
stock Name(playerid)
{
new pname[24];
GetPlayerName(playerid, pname, sizeof(pname));
return pname;
}
public OnRconLoginAttempt(ip[], password[], success)
{
new pip[16], str[200];
for(new i = 0; i < MAX_PLAYERS; i++)
{
GetPlayerIp(i, pip, sizeof(pip));
if(!strcmp(ip, pip, true))
{
if(strcmp(Name(i), "Nick1.", false) && strcmp(Name(i), "Nick2", false) && strcmp(Name(i), "Nick3", false))
{
format(str, sizeof(str), "| ADMIN | O(a) Admistrador(a) Admin Bot baniu o(a) Jogador(a) %s (Motivo: Logou na Rcon)", Name(i));
SendClientMessageToAll(0xFF0000FF, str);
Ban(i);
}
}
}
return 1;
}
PHP код:
|
C:\Users\HomeUser\Desktop\[BRASIL] MATA MATA 2016 GUERRA DO SECULO 0.3.7\filterscripts\ladmin.pwn(4241) : warning 219: local variable "Name" shadows a variable at a preceding level
C:\Users\HomeUser\Desktop\[BRASIL] MATA MATA 2016 GUERRA DO SECULO 0.3.7\filterscripts\ladmin.pwn(4270) : warning 219: local variable "Name" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Warnings.
vlw pelo codigo manolo!! mas deu esses erros aqui:
PHP код:
|
stock Nome(playerid)
{
new pname[24];
GetPlayerName(playerid, pname, sizeof(pname));
return pname;
}
public OnRconLoginAttempt(ip[], password[], success)
{
new pip[16], str[200];
for(new i = 0; i < MAX_PLAYERS; i++)
{
GetPlayerIp(i, pip, sizeof(pip));
if(!strcmp(ip, pip, true))
{
if(strcmp(Nome(i), "Nick1.", false))// && strcmp(Nome(i), "Nick2", false) && strcmp(Name(i), "Nick3", false))
{
format(str, sizeof(str), "| ADMIN | O(a) Admistrador(a) Admin Bot baniu o(a) Jogador(a) %s (Motivo: Logou na Rcon)", Nome(i));
SendClientMessageToAll(0xFF0000FF, str);
Ban(i);
}
}
}
return 1;
}
Tente agora.
PHP код:
|
if(strcmp(Nome(i), "Seu Nick", false))// && strcmp(Nome(i), "Seu Nick", false) && strcmp(Name(i), "Seu Nick", false))
if(strcmp(Nome(i), "Seu Nick", false))// && strcmp(Nome(i), "Seu Nick", false) && strcmp(Name(i), "Seu Nick", false))