30.01.2010, 16:04
My kick code gives me Server Unknown command.
Do you guys know what's wrong?
Do you guys know what's wrong?
pawn Код:
dcmd_kick(playerid, params[])
{
new reason;
new string1[128];
new string2[128];
if(PlayerInfo[playerid][AdminLevel] < LEVEL_KICK) ErrorMessage(playerid, "Error: You don't have a high enough admin level!");
else if (sscanf(params, "us", target, reason)) ErrorMessage(playerid, "Usage: '/kick [playerid] [reason]'");
else if (target == INVALID_PLAYER_ID) ErrorMessage(playerid, "Error: Player not connected!");
else if (PlayerInfo[playerid][AdminLevel] < PlayerInfo[target][AdminLevel]) ErrorMessage(playerid, "Error: Player has a higher admin level then you!");
else
{
SystemMessage(playerid, "Player has been kicked!");
format(string1, sizeof(string1), "You have been kicked by Administrator %s. (Reason: '%s')", PlayerName(playerid), reason);
SendMessage(target, string1);
format(string2, sizeof(string2), "Player %s has been kicked by Administrator %s. (Reason: '%s')", PlayerName(target), PlayerName(playerid), reason);
printf(string2);
SendClientMessageToAll(COLOR_MESSAGE, string2);
KickPlayer(target);
}
return 1;
}