[PEDIDO]: Comando /aviso.
#1

Bom pessoal, caso eu esteja PEDINDO coisas demais desculpem-me
Eu queria o comando /aviso (Escreva algo) e /aviso ID
OBs: Para admins.
Reply
#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
#3

Tenta aкr

pawn Код:
if(!strcmp(cmdtext,"/avisar", 6, true))
{
    if(!cmdtext[8] || cmdtext[8] == ' ')
        return SendClientMessage(playerid, -1, "/avisar <id>");
   
    new
        Av[24],
        Av2[24],
        Str[128]
    ;
   
    GetPlayerName(strval(cmdtext[8]), Av, 24); GetPlayerName(playerid, Av2, 24);
    format(Str, sizeof(Str),"%s ganhou um aviso de %s", Av, Av2);
    SendClientMessage(playerid, -1,  Str);
    return true;
}
Crйditus Eu.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)