12.08.2013, 01:33
(
Последний раз редактировалось MrPaulistinha; 16.08.2013 в 00:00.
)
Tem como fazer isso?
/ban
/ban
pawn Код:
if(strcmp(cmd,"/ban", true) == 0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if (pAdmin[playerid] == 3 || pAdmin[playerid] == 4 || pAdmin[playerid] == 5)
{
new tmp[256];
new plid;
tmp = strtok(cmdtext, idx);
if (!strlen(tmp))
{
SendClientMessage(playerid, Vermelho, "Uso: /ban [id] [motivo]");
return 1;
}
plid = strval(tmp);
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
if (IsPlayerConnected(plid))
{
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, Vermelho, "Uso: /banir [id] [motivo]");
}
else
{
new year, month, day;
getdate(year, month, day);
format(string, sizeof(string), "(INFO) %s baniu o Jogador: %s. || Razгo: %s || %d-%d-%d", aname, pname, result, month, day, year);
BanLog(string);
SendClientMessage(plid, 0x80FF00AA, "» Vocк foi banido deve ter feito alguma merda");
SendClientMessage(plid, 0xFFFFFFAA, "» Se foi banido injustamente Tire uma ''SS'' e tente o contato com um de nossos Admins!");
GameTextForPlayer(plid, "~r~banido", 2500, 3);
format(string, sizeof(string), "(INFO) O Administrador %s baniu o jogador: %s. || Razгo: %s.", aname, pname, result);
SendClientMessageToAll(tcadm, string);
dini_IntSet("banidos.ini", pname, 1);
Ban(plid);
}
}
else
{
format(string, sizeof(string), "(ERRO) ID : %d nгo й valido!", plid);
SendClientMessage(playerid, Vermelho, string);
}
}
return 1;
}