23.03.2012, 00:11
(
Последний раз редактировалось Nicky_Newsted; 23.03.2012 в 00:18.
Причина: Edited title
)
Okay, so now I'm busy making some script that automaticly bans on wrong RCON passwords (actually copied from SAMP Wiki), but ofcourse I don't want myself being banned if I type it in wrong so what to make up a line/code that gets playerid's name and checks it, if it's not some of those names it will go through the next step, sending a line and ban the user.
I have this code right now but it's not working, giving some errors:
In this script line 524 is the GetPlayerName-line.
I hope somebody could help me with this. I just started to learn Pawn this week and I was wondering, and later on might help if I as admin have multiple names, i.e. hidden admin or something.
Cheers
I have this code right now but it's not working, giving some errors:
pawn Код:
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.
I hope somebody could help me with this. I just started to learn Pawn this week and I was wondering, and later on might help if I as admin have multiple names, i.e. hidden admin or something.
Cheers