Need Some Help with /kick
#1

Hi! I have tried editting the basic filterscript to customize it a bit. Here's what I did...

Код:
if(strcmp("/kick", cmd, true) == 0)
	{
	    if(IsPlayerAdmin(playerid)) {
			tmp = strtok(cmdtext,idx);
			if(!strlen(tmp) || strlen(tmp) > 5) {
				return SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"USAGE: /kick [id] [reason]");
			}

			new id = strval(tmp);

			if(!IsPlayerConnected(id)) {
				SendClientMessage(playerid,ERROR,"ERROR: Invalid Player ID");
				return 1;

				}
				if(strlen(gMessage) == 0)
				{
					GetPlayerName(id,iName,sizeof(iName));
					GetPlayerName(playerid,pName,sizeof(pName));
                	format(Message,sizeof(Message),"[INFO] %s [ID:%d] has kicked %s [ID:%d] for: No Reason Specified",pName,playerid,iName,id);
					SendClientMessageToAll(INFO,Message);
					Kick(id);
				{
				else(strlen(gMessage) > 0)  //Line 160
				}
					gMessage = strrest(cmdtext,idx);
					format(Message,sizeof(Message),"[INFO] %s [ID:%d] has kicked %s [ID:%d] for: %s",pName,playerid,iName,id,gMessage);
					SendClientMessageToAll(INFO,Message);
					Kick(id);
					return 1;
				{
				else
				{
            		SendClientMessage(playerid,ERROR,"ERROR: You are not an admin!");
					return 1;
				}
			}
		}
	}
I get these errors:

Код:
C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(58) : warning 225: unreachable code
C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(152) : warning 217: loose indentation
C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(159) : warning 217: loose indentation
C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(160) : error 029: invalid expression, assumed zero
C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(160 -- 161) : warning 215: expression has no effect
C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(161) : error 001: expected token: ";", but found "}"
C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(162) : warning 217: loose indentation
C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(167) : warning 225: unreachable code
C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(167) : warning 217: loose indentation
C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(168) : error 029: invalid expression, assumed zero
C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(178) : warning 217: loose indentation
C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(215) : error 030: compound statement not closed at the end of file (started at line 139)
Reply


Messages In This Thread
Need Some Help with /kick - by Tigerbeast11 - 04.08.2011, 11:11
Re: Need Some Help with /kick - by [MG]Dimi - 04.08.2011, 11:20
Re: Need Some Help with /kick - by Famalamalam - 04.08.2011, 11:21
Re: Need Some Help with /kick - by Tigerbeast11 - 04.08.2011, 11:22
Re: Need Some Help with /kick - by MadeMan - 04.08.2011, 11:24
Re: Need Some Help with /kick - by Tigerbeast11 - 04.08.2011, 11:25
AW: Need Some Help with /kick - by samtey - 04.08.2011, 11:26
Re: Need Some Help with /kick - by Tigerbeast11 - 04.08.2011, 11:27
Re: Need Some Help with /kick - by Wesley221 - 04.08.2011, 11:27
Re: AW: Need Some Help with /kick - by Tigerbeast11 - 04.08.2011, 11:41

Forum Jump:


Users browsing this thread: 2 Guest(s)