01.08.2014, 22:52
No matter what ID or name i type it says the player is not connected
here is the ban player stock
pawn Код:
CMD:ban(playerid, params[])
{
if(!IsAdmin(playerid, 1)) return ErrorMsg(playerid);
new target;
new reason = Info[playerid][BanReason];
if(sscanf(params, "rs[32]", target, reason)) return Usage(playerid, "/ban [player] [reason]");
if(!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected");
new string[128];
format(string, sizeof(string), "[ADMIN BAN]: %s has been banned from the server - %s", Name(target), reason);
SendClientMessageToAll(COLOR_ADMIN, string);
IRC_GroupSay(gGroupID, IRC_CHANNEL, string);
format(string,sizeof(string), "[ADMIN CMD]: %s[%i] has banned %s[%i] - %s",Name(playerid),playerid,Name(target),target,reason);
IRC_GroupSay(gGroupID, IRC_CHANNEL_ADMIN, string);
format(string,sizeof(string), "~w~Banned from the server~n~~r~Reason: %s",reason);
TextDrawSetString(AnnText, string);
TextDrawShowForPlayer(target, AnnText);
BanPlayer(target);
return 1;
}
pawn Код:
stock BanPlayer(playerid)
{
new INI:File = INI_Open(UserPath(playerid));
INI_WriteInt(File,"Banned",1);
INI_WriteInt(File,"BanReason",Info[playerid][BanReason]);
INI_Close(File);
Kick(playerid);
return 1;
}