/ban :P
#1

Hmm i made a /ban command and now i wanted to ban myself(LOLxD) but it dont work
Maybe someone could help me

Quote:

if(strcmp(cmd, "/ban", true) == 0)
{
if(PlayerInfo[playerid][Adminlevel] >= 3)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /ban [playerid] [reason]");
new player1 = strval(tmp);
new Reason[120];
strmid(Reason,cmdtext,strlen(cmd)+strlen(tmp)+2,st rlen(cmdtext));
if(IsPlayerConnected(player1)) {
GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));
format(string,sizeof(string),"You have banned %s from the server!(Reason: %s)", playername, Reason);
SendClientMessage(playerid, COLOR_GREEN, string);
format(string,sizeof(string),"Administrator %s has banned %s from the server!(Reason: %s)",adminname, playername, Reason);
SendClientMessageToAll(COLOR_GREEN, string);
printf("%s has banned %s from the server !(Reason: %s)",adminname, playername, Reason);
Ban(player1);
}
else
{
SendClientMessage(playerid, COLOR_RED, "This player is not connected");
}
return 1;
}

Reply
#2

Код:
if(strcmp(cmd, "/ban", true) == 0)
{
	if(PlayerInfo[playerid][Adminlevel] >= 3)
	{
		tmp = strtok(cmdtext,idx);
		if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /ban [playerid] [reason]");
		new player1 = strval(tmp);
		new Reason[120];
		strmid(Reason,cmdtext,strlen(cmd)+strlen(tmp)+2,strlen(cmdtext));
		if(IsPlayerConnected(player1)) {
			GetPlayerName(player1, playername, sizeof(playername));  GetPlayerName(playerid, adminname, sizeof(adminname));
			format(string,sizeof(string),"You have banned %s from the server!(Reason: %s)", playername, Reason);
			SendClientMessage(playerid, COLOR_GREEN, string);
			format(string,sizeof(string),"Administrator %s has banned %s from the server!(Reason: %s)",adminname, playername, Reason);
			SendClientMessageToAll(COLOR_GREEN, string);
			printf("%s has banned %s from the server !(Reason: %s)",adminname, playername, Reason);
			Ban(player1);
		}else SendClientMessage(playerid, COLOR_RED, "This player is not connected");
	}else SendClientMessage(playerid, COLOR_RED, "Your admin level must be more than 2");
	return 1;
}
Reply
#3

Quote:

C:\Documents and Settings\Eigenaar\Bureaublad\Minigames\filterscrip ts\minigames.pwn(505) : warning 217: loose indentation
C:\Documents and Settings\Eigenaar\Bureaublad\Minigames\filterscrip ts\minigames.pwn(529) : warning 217: loose indentation
C:\Documents and Settings\Eigenaar\Bureaublad\Minigames\filterscrip ts\minigames.pwn(554) : warning 209: function "OnPlayerCommandText" should return a value
C:\Documents and Settings\Eigenaar\Bureaublad\Minigames\filterscrip ts\minigames.pwn(555) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

Lines
Quote:

}
}
}
return 1;
}

Reply
#4

Its not in this command.
Reply
#5

I deleted a { but it still dont work..
Reply
#6

pawn Код:
}
}
  return 1;
  }
return 0;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)