cant kick and ban on server, i am admin 1338 - WHY?
#1

hello, here is my code
Код:
  if(strcmp(cmd, "/kick", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
	  	tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Koristi: /kick [playerid/PartOfName] [reason]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			if (PlayerInfo[playerid][pAdmin] >= 1)
			{
				if(IsPlayerConnected(giveplayerid))
				{
				  if(giveplayerid != INVALID_PLAYER_ID)
				  {
					  GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						new length = strlen(cmdtext);
						while ((idx < length) && (cmdtext[idx] <= ' '))
						{
							idx++;
						}
						new offset = idx;
						new result[64];
						while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
						{
							result[idx - offset] = cmdtext[idx];
							idx++;
						}
						result[idx - offset] = EOS;
						if(!strlen(result))
						{
							SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /kick [playerid/PartOfName] [reason]");
							return 1;
						}
						new year, month,day;
						getdate(year, month, day);
						format(string, sizeof(string), "AdmCmd: %s je kikovan od strane %s, razlog: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
						KickLog(string);
						Kick(giveplayerid);
						format(string, sizeof(string), "AdmCmd: %s je kikovan od strane %s, razlog: %s", giveplayer, sendername, (result));
						SendClientMessageToAll(COLOR_LIGHTRED, string);
						return 1;
					}
				}
			}
			else
			{
				format(string, sizeof(string), "  %d nije aktivan igrac.", giveplayerid);
				SendClientMessage(playerid, COLOR_GRAD1, string);
			}
		}
		return 1;
	}
i am admin 1338 on my server and when i type /kick a get message YOU ARE NOT ADMIN. why and how to fix it, the same thing is and when i try to ban somebody
Reply
#2

You can't kick and ban, because that commands is in rcon.
You can rename /ban and /kick command in your admin script and then it works.
Sorry for my bad english :/
Reply
#3

what to rename? i find cmd but i dont know what to rename :S
Reply
#4

Quote:
Originally Posted by Reezmi
You can't kick and ban, because that commands is in rcon.
You can rename /ban and /kick command in your admin script and then it works.
Sorry for my bad english :/
It is not RCON.
Reply
#5

change:
if(strcmp(cmd, "/kick", true) == 0)
in:
if (strcmp("/kick", cmdtext, true, 5) == 0)


5 is the lenght of the command inluding the slash
haven't wacthed the rest of you code, think thats it...

Reply
#6

Is easy, to solve you open server.cfg and delete all filterscripts of 0.3a
and try again.
Reply
#7

Quote:
Originally Posted by Guiihz
Is easy, to solve you open server.cfg and delete all filterscripts of 0.3a
and try again.
...?
Reply
#8

learn the basics before even trying making a mod...
or atleast learn what the contents of server.cfg is
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)