[PEDIDO]: Comando /aviso.
#2

pawn Код:
if(strcmp(cmd, "/aviso", true) == 0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(pAdmin[playerid] == 2 || pAdmin[playerid] == 3 || pAdmin[playerid] == 4 || pAdmin[playerid] == 5){
new tmp[256];
new plid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, Vermelho, "Digite: /aviso [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: /aviso [id] [motivo]");
}
else
{
aviso[plid]+=1;
if(aviso[plid]>= 3)
{
format(string, sizeof(string), "(INFO) %s foi kickado por receber 3 avisos!",pname);
SendClientMessageToAll(tcadm, string);
Kick(plid);
}
format(string, sizeof(string), "(INFO) O administrador %s avisou o jogador %s (Motivo: %s) (%d/3)", aname,pname,result,aviso[plid]);
SendClientMessageToAll(tcadm, string);
}
}
else
{
format(string, sizeof(string), " (ERRO) ID %d invбlido!", plid);
SendClientMessage(playerid, Vermelho, string);
}
}
return 1;
}
Espero ter ajudado!
Reply


Messages In This Thread
[PEDIDO]: Comando /aviso. - by Biel.G8B - 28.02.2012, 18:16
Re: [PEDIDO]: Comando /aviso. - by GuiihCamargo - 28.02.2012, 18:23
Re: [PEDIDO]: Comando /aviso. - by DarkScripter - 28.02.2012, 18:46

Forum Jump:


Users browsing this thread: 1 Guest(s)