New Admin Command Not WORKING (filterscript)
#1

So i have this problem when the command doesnt detect me as an admin.

Old CMD
Код:
CMD:ban(playerid,params[])
{
	if(pInfo[playerid][pLogged] == 1)
	{
		if(pInfo[playerid][pAdminLevel] >= 2)
		{
			if(IsPlayerConnected(playerid))
			{
				new targetid,reason[105],string[256];
				if(sscanf(params, "us[105]", targetid,reason)) return SendClientMessage(playerid,-1,""chat" /ban [playerid] [reason]");
				if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,""chat" Player is not online");
				format(string, sizeof(string), ""chat""COL_LIGHTBLUE" %s %s has banned %s [Reason: %s]",GetAdminName(playerid),PlayerName(playerid),PlayerName(targetid),reason);
				SendClientMessageToAll(-1,string);
				printf("%s %s has banned %s [Reason: %s]",GetAdminName(playerid),PlayerName(playerid),PlayerName(targetid),reason);
				pInfo[targetid][pBanned] = 1;
				BanPlayer(targetid,reason,GetAdminName(playerid));
			}
		}

		else
		{
			SendClientMessage(playerid,-1,""chat""COL_LIGHTBLUE" You do not have the right admin permissions for this command!");
		}
	}
    else if(pInfo[playerid][pLogged] == 0)
	{
		SendClientMessage(playerid,-1,""chat""COL_LIGHTBLUE" Nice try u fucking fag gay!");
		printf("%s has been kicked for trying to use a command without being logged in!", PlayerName(playerid));
		Kick(playerid);
	}
	return 1;
}
New CMD
Код:
COMMAND:ban(playerid,params[])
{
	if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFF0000FF,"This command is only for administrators.");
	new PlayerID;
	new Days;
	new Reason[30];
	if(sscanf(params,"iis[30]",PlayerID,Days,Reason)) return SendClientMessage(playerid,0xFF0000FF,"Usage /Ban [Player ID] [Days] [Reason].");
	if(!IsPlayerConnected(PlayerID)) return SendClientMessage(playerid,0xFF0000FF,"Player with this ID isnt available.");
	if(Days <= 0) return SendClientMessage(playerid,0xFF0000FF,"You entered bad time.");
	if(strlen(Reason) <= 0 || strlen(Reason) > 30) return SendClientMessage(playerid,0xFF0000FF,"You must give reason, but not too long, maximally 30 characters.");
	new String[300];
	TB_BanPlayerByID(PlayerID,Days * 24 * 60 * 60,Reason,playerid);
	new PlayerName[30];
	GetPlayerName(PlayerID,PlayerName,sizeof(PlayerName));
	format(String,sizeof(String),"You banned player %s (ID: %d) at time %s. Reason: %s",PlayerName,PlayerID,TB_ConvertTime(Days * 24 * 60 * 60),Reason);
	SendClientMessage(playerid,0xFF0000FF,String);
	return 1;
}
So is there anyway i can replace the new cmd with the old one. Everytime i try to use the new cmd /ban even tho im admin it shows me the message "This command is only for administrators."
I really need help on this one maybe some explanations too. Thanks. +1 Rep for the solver <3
Reply


Messages In This Thread
New Admin Command Not WORKING (filterscript) - by flamur2012 - 14.07.2014, 21:56
Re: New Admin Command Not WORKING (filterscript) - by azzerking - 14.07.2014, 22:00
Re : New Admin Command Not WORKING (filterscript) - by ManuelNeuer - 14.07.2014, 22:06
Re: New Admin Command Not WORKING (filterscript) - by flamur2012 - 14.07.2014, 22:07
Re: New Admin Command Not WORKING (filterscript) - by flamur2012 - 14.07.2014, 22:29

Forum Jump:


Users browsing this thread: 1 Guest(s)