so my command is like this:
pawn Код:
if(strcmp(cmd, "/blacklist", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /BlackList [Nume] [Motiv");
return 1;
}
giveplayerid = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
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, "USAGE: /BlackList [Nume] [Motiv");
return 1;
}
new playername3[MAX_PLAYER_NAME];
new string3[64];
GetPlayerName(giveplayerid, playername3, sizeof(playername3));
format(string3, sizeof(string3), "users/%s.ini", playername3);
new File: hFile = fopen(playername3, io_write);
if (hFile)
{
PlayerInfo[playerid][pBlackList] = 1;
format(string, sizeof(string), "AdmCmd: %s a fost adaugat in BlackList de catre %s, Motiv: %s", giveplayer, sendername, (result));
BlackListLog(string);
format(string, sizeof(string), "AdmCmd: %s a fost adaugat in BlackList de catre %s, Motiv: %s", giveplayer, sendername, (result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
fclose(hFile);
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, " Doar adminii pot folosi aceasta comanda!!!");
return 1;
}
}
return 1;
}
but is baning myself /blacklist myname non-rp name. = Im_BanK was added in the BlackList by Im_BanK , reason: non-rp name.
why is that happening>?
What can i do to ban the writed name.?