#1

It doesnt give ban= 1 on .ini file

Код:
CMD:ban(playerid, params[])
{
	if(AdminDuty[playerid] == 0) return SendClientMessage(playerid, -1, "You must be on Admin Duty to use this Command!");
	if (PlayerInfo[playerid][pAdmin] >= 2 || PlayerInfo[playerid][pBanAppealer] == 1)
	{
		new string[128], giveplayerid, reason[64], string2[128];
		if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /ban [playerid] [reason]");

		if(IsPlayerConnected(giveplayerid))
		{
			if(PlayerInfo[giveplayerid][pAdmin] > PlayerInfo[playerid][pAdmin])
			{
                format(string, sizeof(string), "AdmCmd: %s has been auto-banned, reason: Trying to /ban a higher admin.", GetPlayerNameEx(playerid));
				SendClientMessageToAllEx(COLOR_LIGHTRED, string);
                PlayerInfo[playerid][pBanned] = 1;
                new ip[32], cw[64], tstring[128], year, month, day, hour, minute, second;
                GetPlayerIp(playerid,ip,sizeof(ip));
                AddBan(ip);
                getdate(year, month, day);
                gettime(hour, minute, second);
                format(tstring, sizeof(tstring), "Date/Time: %i/%i/%i, %i:%i:%i", day, month, year, hour, minute, second);
				format(cw, sizeof(cw), "Current Warnings: %i (3 for Ban)", PlayerInfo[playerid][pWarns]);
				ABroadCast(COLOR_LIGHTRED, string, 1);
                SendClientMessage(playerid, COLOR_REALRED, "--------------------- BAN REPORT ---------------------");
                SendClientMessage(playerid, COLOR_WHITE, cw);
                SendClientMessage(playerid, COLOR_WHITE, "Staff: Server");
                SendClientMessage(playerid, COLOR_WHITE, "Reason: Tried to ban a higher admin");
                SendClientMessage(playerid, COLOR_WHITE, tstring);
                SendClientMessage(playerid, COLOR_REALRED, "Make sure you have the Screenshot of this ban by pressing (F8)");
                SendClientMessage(playerid, COLOR_REALRED, "Feel free to post a ban appeal at www.ph-roleplay.yzi.me .Have a nice day!");
                SendClientMessage(playerid, COLOR_REALRED, "-------------------------------------------------------");
                KickWithMessage(playerid, COLOR_REALRED, "Your Banned from Philippines Roleplay");
                return 1;
			}
			else
			{
			    format(string2, sizeof(string2), "AdmCmd: %s has been banned by %s, Reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
                SendClientMessageToAllEx(COLOR_LIGHTRED, string2);
                PlayerInfo[giveplayerid][pBanned] = 1;
                new ip[32];
                GetPlayerIp(giveplayerid,ip,sizeof(ip));
                AddBan(ip);
                new cw[64], tstring[128], sstring[128], rstring[128],year, month, day, hour, minute, second;
                getdate(year, month, day);
                gettime(hour, minute, second);
                format(tstring, sizeof(tstring), "Date/Time: %i/%i/%i, %i:%i:%i", day, month, year, hour, minute, second);
                format(sstring, sizeof(sstring), "Staff: %s", GetPlayerNameEx(playerid));
                format(rstring, sizeof(rstring), "Reason: %s", reason);
				format(cw, sizeof(cw), "Current Warnings: %i (3 for Ban)", PlayerInfo[giveplayerid][pWarns]);
                SendClientMessage(giveplayerid, COLOR_REALRED, "--------------------- BAN REPORT ---------------------");
                SendClientMessage(giveplayerid, COLOR_WHITE, cw);
                SendClientMessage(giveplayerid, COLOR_WHITE, sstring);
                SendClientMessage(giveplayerid, COLOR_WHITE, rstring);
                SendClientMessage(giveplayerid, COLOR_WHITE, tstring);
                SendClientMessage(giveplayerid, COLOR_REALRED, "Make sure you have the Screenshot of this ban by pressing (F8)");
                KickWithMessage(giveplayerid, COLOR_REALRED, "Feel free to post a ban appeal at [www.ph-roleplay.yzi.me]");
                return 1;
			}

		}
	}
	else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player ID! Press Tab!.");
	return 1;
}
Reply
#2

This is normal. You don't have the pawn code for do that no ?
Reply
#3

Have you save it, with Y_INI or something ?
Reply
#4

Quote:
Originally Posted by Noliax8
Посмотреть сообщение
This is normal. You don't have the pawn code for do that no ?
So, i could i fix it? its annoying
Reply
#5

I forgotten,

Show we the function AddBan(ip).
Reply
#6

Quote:
Originally Posted by RenovanZ
Посмотреть сообщение
Have you save it, with Y_INI or something ?
yes Y_INI
Reply
#7

Quote:
Originally Posted by Noliax8
Посмотреть сообщение
I forgotten,

Show we the function AddBan(ip).
Код:
stock AddBan(ip[])
{
	if(CheckBan(ip) == 0)
	{
		new File: file = fopen("ban.cfg", io_append);
		new string[20];
		format(string, sizeof(string), "\n%s", ip);
	 	fwrite(file, string);
	 	fclose(file);
	 	foreach(Player, playerid)
		{
		    new playerIP[16];
			GetPlayerIp(playerid, playerIP, sizeof(playerIP));
			if(strcmp(playerIP, ip) == 0)
			{
	            KickWithMessage(playerid, COLOR_REALRED, "You're banned from Philippines Roleplay. You can appeal your ban at www.ph-roleplay.yzi.me");
			}
		}
		return 1;
	}
	return 0;
}
Reply
#8

Quote:
Originally Posted by Noliax8
Посмотреть сообщение
Show we the function AddBan(ip).
Normally, it's inside the function AddBan() no ? Send us

EDIT: So, the server ban with a another file. You can to make yourself the pawn code with Y_INI
Reply
#9

Quote:
Originally Posted by Noliax8
Посмотреть сообщение
Normally, it's inside the function AddBan() no ? Send us

EDIT: So, the server ban with a another file. You can to make yourself the pawn code with Y_INI
i dont have the addban() it only shows the addban(ip)
Reply
#10

Quote:
Originally Posted by ChristianIvann09
Посмотреть сообщение
i dont have the addban() it only shows the addban(ip)
I'm so sorry, i forgot to specify the params. But of course, addban(ip)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)