CMD:oban(playerid,params[])
{
new id, string[500];
if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_RED,"USAGE:{FFFFFF}/oban [ACCOUNT NAME]");
if(dini_Exists(Account(id)))
{
banned[id] = 1;
dini_IntSet(Account(id),"banned",banned[id]);
format(string,sizeof(string),""COL_LIME"Account %s has been banned",id);
SendClientMessageToAll(COLOR_YELLOW,string);
return 1;
}
else
{
SendClientMessage(playerid, -1, "That player does not exist!");
}
return 1;
}
|
It's offline ban, Which means the player is not online. How can you ban him with his ID? lol
You should ban with his name, not ID. |


CMD:oban(playerid, params[])
{
if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "USAGE:{FFFFFF}/oban [ACCOUNT NAME]");
new
account[40] = "Accounts/";
strcat(account, strcat);
strins(account, ".ini");
if(!dini_Exists(account)) return SendClientMessage(playerid, -1, "That player does not exist!");
dini_IntSet(account, "banned", 1);
new
string[64];
format(string, sizeof(string), ""COL_LIME"Account %s has been banned", params);
SendClientMessageToAll(COLOR_YELLOW,string);
return 1;
}
CMD:ofban(playerid, params[])
{
if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "USAGE:{FFFFFF}/oban [ACCOUNT NAME]");
new
account[40] = "users/";
strcat(account, strcat);
strins(account, ".ini");
if(!dini_Exists(account)) return SendClientMessage(playerid, -1, "That player does not exist!");
dini_IntSet(account, "banned", 1);
new
string[64];
format(string, sizeof(string), ""COL_LIME"Account %s has been banned", params);
SendClientMessageToAll(COLOR_YELLOW,string);
return 1;
}
C:\Users\John\Desktop\projects 2016\ESDS 0.3.7 NEW\gamemodes\ESDS.pwn(4650) : error 076: syntax error in the expression, or invalid function call
CMD:ofban(playerid, params[])
{
if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "USAGE:{FFFFFF}/oban [ACCOUNT NAME]");
new
account[40] = "users/";
strcat(account, params);
strins(account, ".ini");
if(!dini_Exists(account)) return SendClientMessage(playerid, -1, "That player does not exist!");
dini_IntSet(account, "banned", 1);
new
string[64];
format(string, sizeof(string), ""COL_LIME"Account %s has been banned", params);
SendClientMessageToAll(COLOR_YELLOW,string);
return 1;
}