13.11.2014, 17:28
Alright i have now got a rcon attempt in my script and it bans you when you have done 3 bad rcon attempts, but it bans in samp.ban file but i want it to ban in the users file, so it would say
Password: frerghtfgww
Money:
Banned:
Etc...
I have the code here:
I have this as my banned:
If you can help me i will be very grateful. thank you
Edit --------------------------------------------------------------
I also have a problem with my ban command, it doesn't ban a player it only shows me the usage of the command, i type /ban ID Reason but it just shows me the usage can someone help me find out why it's not banning
Password: frerghtfgww
Money:
Banned:
Etc...
I have the code here:
Код:
#define MAX_RCON_ATTEMPS 3
Код:
public OnRconLoginAttempt(ip[], password[], success) { if(!success) { if(!dini_Exists("Logs/Badrcons.txt")) dini_Create("Logs/Badrcons.txt"); new attempts=dini_Int("Logs/Badrcons.txt",ip); attempts++; if(attempts>=MAX_RCON_ATTEMPS) { new cmd[32]; format(cmd,sizeof(cmd),"banip %s",ip); SendRconCommand(cmd); } dini_IntSet("Logs/Badrcons.txt",ip,attempts); } return 1; }
Код:
INI_WriteInt(file,"Banned",pInfo[playerid][Banned]);
Edit --------------------------------------------------------------
I also have a problem with my ban command, it doesn't ban a player it only shows me the usage of the command, i type /ban ID Reason but it just shows me the usage can someone help me find out why it's not banning
Код:
ACMD:ban(playerid, params[]) { if (pInfo[playerid][Adminlevel] < 2) return 0; new R[25], string[250]; if(sscanf(params, "ui", ID, R)) return SendClientMessage(playerid, red, "--- /ban <ID> <Reason> ---"); if(ID == IPI) return SCM(playerid, red, "Player is not connected!"); pInfo[playerid][Banned]=1; GetPlayerName(ID,pname,MAX_PLAYER_NAME); GetPlayerName(playerid,Nam, MAX_PLAYER_NAME); format(string, sizeof(string), "%s %s has banned %s for %s", AdminLevelName(playerid),Nam, pname, R); SendClientMessageToAll(red, string); Kick(ID); return 1; }