help me fix this /kick command error -
mittukuttan - 11.01.2013
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.
Re: help me fix this /kick command error -
Oscii - 11.01.2013
Change SCM to SendClientMessage.
Re: help me fix this /kick command error -
SilverKiller - 11.01.2013
Rename SCM in the script with - SendClientMessage.
Re: help me fix this /kick command error -
mittukuttan - 11.01.2013
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.
Re: help me fix this /kick command error -
Infinity90 - 11.01.2013
It would be nice if you used tags for the code... Show us the line 597 - 606
Re: help me fix this /kick command error -
mittukuttan - 11.01.2013
line 604:format(kickstring, sizeof(kickstring), "AdmCmd:%s has kicked %s for : %s", aName, pName, reason);
line: 605 SendClientMessageToAll
Re: help me fix this /kick command error -
SilverKiller - 11.01.2013
Type lines from, 597 to 606 Not 604 and 605 only.
Re: help me fix this /kick command error -
Jay_Dixon - 11.01.2013
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;
}
Re: help me fix this /kick command error -
mittukuttan - 12.01.2013
help me out guys
Re: help me fix this /kick command error -
mittukuttan - 12.01.2013
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.