[URGENT]Why is this happening?!
#1

So whenever I try to ban someone, it bans him but it bans everyone on the server too. And then I need to delete samp.ban so everyone could be unbanned. Help?!
Reply
#2

Show ur /ban command
Reply
#3

Quote:

if(strcmp(cmd, "/ban", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new playersip[64];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "{FF8306}KORISTETE:{FFFFFF} /ban [ID/Ime na Igracot] [pricina].");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(giveplayerid))
{
if(PlayerInfo[giveplayerid][pAdmin] >= 133
{
SendClientMessage(playerid, COLOR_WHITE, "{FF0000}GRESKA:{FFFFFF}Nemozete da banirate Administrator pogolem level od vas.");
return 1;
}
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerIp(giveplayerid,playersip,sizeof(playersi p));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_WHITE, "{FF8306}KORISTETE:{FFFFFF}/ban [ID/Ime na Igracot] [pricina].");
return 1;
}
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
SendClientMessage(giveplayerid,COLOR_NICERED, "_________________________________________________ ___________________________________");
SendClientMessage(giveplayerid,COLOR_WHITE, "Banirani ste na serverot, procitajte go tekstot.");
format(string,sizeof(string), "DL BAN | %s banirani ste od Administrator %s",giveplayer, giveplayerid, sendername);
SendClientMessage(giveplayerid, COLOR_NICERED, string);
BanLog(string);
format(string,sizeof(string), "Pricina za ban: %s ", (result));
SendClientMessage(giveplayerid, COLOR_NICERED, string);
BanLog(string);
format(string,sizeof(string), "Datum: %d/%d/%d, Vreme: %d:%d:%d | Vasata IP adresa: %s ",d,m,y,h,mi,s, playersip);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
SendClientMessage(giveplayerid,COLOR_WHITE, "Vasata korisnicka smetka e banirana zasekogas!");
SendClientMessage(giveplayerid,COLOR_ORANGE, "Dokolku mislite deka nepravedno ste banirani slikajte so F8 i pobarajte unban na www.DreamLifeGaming.webs.com");
SendClientMessage(giveplayerid,COLOR_NICERED, "_________________________________________________ ___________________________________");
format(string, sizeof(string), "DL BAN | {FFFFFF}%s | Administrator: %s | Pricina: "COL_RED"%s {FFFFFF}Datum: %d/%d/%d | Vreme: %d:%d:%d", giveplayer, sendername, (result),d,m,y,h,mi,s);
ABroadCast(NICERED,string,1);
format(string, sizeof(string), "DL BAN | %s e baniran od Administrator %s.", giveplayer, sendername);
SendClientMessageToAll(NICERED, string);
//PlayerInfo[giveplayerid][pLocked] = 1;
Ban(giveplayerid);
return 1;
}

There it is.
Reply
#4

your ban command must be like that
Code:
dcmd_ban(playerid,params[])
{
	if(AccInfo[playerid][LoggedIn] == 1)
	{
		if(AccInfo[playerid][Level] >= 5)
		{
			new Index;
		    new tmp[256];  tmp  = strtok(params,Index);
			new tmp2[256]; tmp2 = strtok(params,Index);

		    if(!strlen(params)) return
			SendClientMessage(playerid, LIGHTBLUE2, "Usage: /ban [PlayerID] [Reason]") &&
			SendClientMessage(playerid, orange, "Function: Will Ban the specified player");
			if(!strlen(tmp2))
			return SendClientMessage(playerid, red, "WARNING: Reason unspecified!");
			new player1;
	    	new string[128];
			new playername[MAX_PLAYER_NAME];
		 	new adminname [MAX_PLAYER_NAME];
			player1 = strval(tmp);

		 	if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (AccInfo[player1][Level] != ServerInfo[MaxAdminLevel]))
			{
				GetPlayerName(player1, playername, sizeof(playername));
				GetPlayerName(playerid, adminname, sizeof(adminname));
				new year,month,day; getdate(year, month, day);
				new hour,minuite,second; gettime(hour,minuite,second);
				SendCommandToAdmins(playerid,"Ban");
				format(string,sizeof(string),"<<<<<<-%s has been Banned by vip %s | Reason: %s [Date: %d/%d/%d] [Time: %d:%d]",playername,adminname,params[2],day,month,year,hour,minuite);
    			SendClientMessageToAll(lightred,string);
    			new str[128];
				format(str,sizeof(str),"%s has been Banned by Vip %s | Reason: %s",playername,adminname,params[2]);
				SaveIn("BanLog",str);
				print(string);
				if(udb_Exists(PlayerName2(player1)) && AccInfo[player1][LoggedIn] == 1)
				dUserSetINT(PlayerName2(player1)).("Banned",1);
				format(string,sizeof(string),"Banned by VIP %s. | Reason: %s",adminname,params[2]);
				return BanEx(player1, string);
			}
			else return SendClientMessage(playerid, red, "ERRPR: Player is not connected or is yourself or is the highest level admin");
		}
		else return WARNINGMessages(playerid, 11);
	}
	else return SendClientMessage(playerid,red,"WARNING: You must be logged in to use this commands");
}
but you must have dcmd.inc
Reply
#5

Can you please please please please give me a link of dcmd ? <3
Reply
#6

Quote:
Originally Posted by RazorMaster
View Post
Can you please please please please give me a link of dcmd ? <3
Just add this on top of your script [under includes]
pawn Code:
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
Reply
#7

http://www.solidfiles.com/d/29b0aa68...d7c76/dcmd.inc
go in that link and click on " Regular download link "
Reply
#8

I did add that and it just says that the script was compiled but the pawno log file is just blank and the "compiled" thingy is 0 KB.. Help?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)