22.03.2014, 15:15
You will need an int called Banned and also change the name of "/users/" to whatever the name of your folder where you store your players info is.
pawn Код:
CMD:offlineban(playerid, params[])
{
new targetname[24], filestring[79];
if(sscanf(params, "s[24]", targetname)) return SendClientMessage(playerid, COLOR_GREY, "[Usage:] /offlineban [playerName]");
format(filestring, sizeof(filestring), "/users/%s.ini", targetname);
if(!fexist(filestring)) return SendClientMessage(playerid, COLOR_LIGHTRED, "That player does not exist.");
else
{
new INI:File = INI_Open(filestring);
INI_SetTag(File, "data");
INI_WriteInt(File, "Banned", 1);
INI_Close(File);
new done[128];
format(done, sizeof(done), "You have successfully banned player %s.", targetname);
SendClientMessage(playerid, -1, done);
}
return 1;
}