Ath9's post in Problema ban offline. was marked as the answer
if(strcmp(cmd, "/banoff", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /banoff [AccountName] [reason]");
return 1;
}
if (PlayerInfo[playerid][pAdmin] >= 1337 )
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /banoff [AccountName] [reason]");
return 1;
}
format(string, sizeof(string), "users/%s.ini", tmp);
if ( !fexist ( string ) )
return SendClientMessage ( playerid, -1, "* Nu exista un jucator cu acel nume ." );
freplaceline ( string, "Locked=0n", "Locked=1n" );
new year, month,day;
getdate(year, month, day);
format(string, sizeof(string), "%s, was locked by, %s, reason:, %s, (%d-%d-%d), LockAcc,", tmp, sendername, (result),day,month,year);
BanLog(string);
format(string, sizeof(string), "[SERVER] Account %s was locked by %s, reason: %s", tmp, sendername, (result));
ABroadCast(COLOR_LIGHTRED,string,1);
}
else
{
format(string, sizeof(string), "Nu ai acces sa utilizezi aceasta camanda", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}