help me fix this /kick command error
#1

CMD:kick(playerid, params[]){ new pID, aName[MAX_PLAYER_NAME], // Name of the admin that kicked player pName[MAX_PLAYER_NAME], // Name of the kicked player reason[64], kickstring[256]; if(sscanf(params, "us[64]", pID, reason) return SCM(playerid, COL_WHITE, " USAGE:/kick [playerid/name] [reason]"); if(!IsPlayerAdmin(playerid)) { SendClientMessage(playerid, COL_RED, " You are not allowed to do that!"); } else { format(kickstring, sizeof(kickstring), "AdmCmd:%s has kicked %s for : %s", aName, pName, reason); SendClientMessageToAll(COL_RED, kickstring); Kick(pID); } return 1;}



MY ERRORS ARE THESE:

C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\gamemodes\YOUNGS-WORLD.pwn(596) : error 001: expected token: ")", but found "return"
C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\gamemodes\YOUNGS-WORLD.pwn(596) : error 017: undefined symbol "SCM"
C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\gamemodes\YOUNGS-WORLD.pwn(604 -- 605) : error 076: syntax error in the expression, or invalid function call
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Reply
#2

Change SCM to SendClientMessage.
Reply
#3

Rename SCM in the script with - SendClientMessage.
Reply
#4

C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\gamemodes\YOUNGS-WORLD.pwn(597) : error 001: expected token: ")", but found "return"
C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\gamemodes\YOUNGS-WORLD.pwn(605 -- 606) : error 076: syntax error in the expression, or invalid function call
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#5

It would be nice if you used tags for the code... Show us the line 597 - 606
Reply
#6

line 604:format(kickstring, sizeof(kickstring), "AdmCmd:%s has kicked %s for : %s", aName, pName, reason);
line: 605 SendClientMessageToAll
Reply
#7

Type lines from, 597 to 606 Not 604 and 605 only.
Reply
#8

Code:
CMD:kick(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin] >= 1)
	{
	    new giveplayerid,result[51];
    	if(!sscanf(params, "us[50]", giveplayerid,result))
		{
			if(IsPlayerConnected(giveplayerid))
			{
			    new string[128];
				new giveplayer[MAX_PLAYER_NAME],sendername[MAX_PLAYER_NAME];
		    	giveplayer = PlayerNameEx(giveplayerid);
		    	sendername = PlayerNameEx(playerid);
			    if(PlayerInfo[giveplayerid][pAdmin] <= PlayerInfo[playerid][pAdmin])
				{
					new year, month,day;
					getdate(year, month, day);
					format(string, sizeof(string), "AdmCmd: %s was kicked by %s, Reason: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
					KickLog(string);
					format(string, sizeof(string), "AdmCmd: %s was kicked by %s, Reason: %s", giveplayer, sendername, (result));
					foreach(Player, i)
					{
					    SendClientMessage(i, COLOR_LIGHTRED, string);
					}
					//BroadCast(COLOR_LIGHTRED, string);
					Kick(giveplayerid);
					return 1;
				}
				else
				{
					SendClientMessage(playerid, COLOR_LIGHTRED,"You can't kick higher admins!");
					format(string, sizeof(string), "AdmCmd: %s tried to kick %s.",sendername,  giveplayer);
					printf("%s",string);
					format(string, sizeof(string), "AdmCmd: %s attempted to kick %s.",sendername,giveplayer);
					ABroadCast(COLOR_LIGHTRED,string,1);
					return 1;
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_LIGHTRED, "   Invalid player!");
			    return 1;
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /Kick [playerid/PartOfName] [Reason]");
		    return 1;
		}
	}
	return 1;
}
Reply
#9

help me out guys
Reply
#10

C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\pawno\include\sscanf.inc(173) : error 017: undefined symbol "foreach"
C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\pawno\include\sscanf.inc(175) : error 017: undefined symbol "playerid"
C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\pawno\include\sscanf.inc(17 : error 017: undefined symbol "playerid"
C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\gamemodes\YOUNGS-WORLD.pwn(592) : error 017: undefined symbol "PlayerInfo"
C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\gamemodes\YOUNGS-WORLD.pwn(592) : warning 215: expression has no effect
C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\gamemodes\YOUNGS-WORLD.pwn(592) : error 001: expected token: ";", but found "]"
C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\gamemodes\YOUNGS-WORLD.pwn(592) : error 029: invalid expression, assumed zero
C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\gamemodes\YOUNGS-WORLD.pwn(592) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


7 Errors.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)