public OnRconLoginAttempt(ip[], password[], success)
{
if(!success) //If the password was incorrect
{
if(GetPlayerName(playerid, "Nicky_Newsted, [TCL]Nicky"));
{
SendClientMessage(playerid, COLOR_RED, "Wrong password!!");
}
else
printf("FAILED RCON LOGIN BY IP %s USING PASSWORD %s",ip, password);
new pip[16];
for(new i=0; i<MAX_PLAYERS; i++) //Loop through all players
{
GetPlayerIp(i, pip, sizeof(pip));
if(!strcmp(ip, pip, true)) //If a player's IP is the IP that failed the login
{
// SendClientMessage(i, 0xFFFFFFFF, "Wrong Password. Bye!"); //Send a message
SendClientMessage(i, COLOR_RED, "You have tried to login at RCON but you don't have the");
SendClientMessage(i, COLOR_RED, "password. You have been banned for trying");
SendClientMessage(i, COLOR_RED, "to hack using RCON");
Ban(i); //They are now banned.
}
}
}
return 1;
}
D:\Games\Valve\Steam\SteamApps\common\grand theft auto san andreas\SAMP Server\gamemodes\nhendriksgm.pwn(524) : error 017: undefined symbol "playerid" D:\Games\Valve\Steam\SteamApps\common\grand theft auto san andreas\SAMP Server\gamemodes\nhendriksgm.pwn(524) : error 036: empty statement D:\Games\Valve\Steam\SteamApps\common\grand theft auto san andreas\SAMP Server\gamemodes\nhendriksgm.pwn(526) : error 017: undefined symbol "playerid" D:\Games\Valve\Steam\SteamApps\common\grand theft auto san andreas\SAMP Server\gamemodes\nhendriksgm.pwn(528) : error 029: invalid expression, assumed zero Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
name[24], pname;
pname = GetPlayerName(playerid, name, sizeof(name));
if(pname == desired name here || pname == other desired name here)
{
// your code here
}
It says that the names aren't found (undefined symbol), and something about assumed 0..
And as well again 'undefined symbol' on 'playerid' in GetPlayerName :S
public OnRconLoginAttempt(ip[], password[], success)
{
if(!success)
{
if(strcmp(ip, "YOUR IP HERE", true))
{
printf("Wrong password!!");
}
}
else
{
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, COLOR_RED, "You have tried to login at RCON but you don't have the");
SendClientMessage(i, COLOR_RED, "password. You have been banned for trying");
SendClientMessage(i, COLOR_RED, "to hack using RCON");
Ban(i);
}
}
}
return 1;
}
|
i think this should be fine
pawn Код:
|
public OnRconLoginAttempt(ip[], password[], success)
{
if(!success)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new playername[24];
GetPlayerName(i, playername, sizeof(playername));
if(strcmp(playername, "Nicky_Newsted", true) == 13 || strcmp(playername, "[TCL]Nicky", true) == 10)
{
SendClientMessage(i, COLOR_RED, "Wrong password!!");
}
}
}
else
{
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, "Wrong Password. Bye!");
SendClientMessage(i, COLOR_RED, "You have tried to login at RCON but you don't have the");
SendClientMessage(i, COLOR_RED, "password. You have been banned for trying");
SendClientMessage(i, COLOR_RED, "to hack using RCON");
Ban(i);
}
}
}
return 1;
}