[Ajuda] Comando /kick -
Cheleber_Pausini - 03.07.2014
Bem, nesse comando qualquer id que eu dк, mesmo sem estar conectado ou mesmo sendo um id invalido, aparece isso o [ADMIN] %s kikou o player %s. Motivo: %s...
Mesmo depois te eu ter colocado esta linha:
Код:
if(id == playerid || id == INVALID_PLAYER_ID || !IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "! Vocк nгo pode se kickar / ID Invбlido / Jogador offline");
CУDIGO:
Код:
CMD:kick(playerid, params[])
{
new motivo[240];
new id;
new nome[MAX_PLAYER_NAME];
new nome1[MAX_PLAYER_NAME];
new Str[240];
new Str1[240];
if(id == playerid || id == INVALID_PLAYER_ID || !IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "! Vocк nгo pode se kickar / ID Invбlido / Jogador offline");
if(adminstatus[playerid] == 1) return SendClientMessage(playerid, COR_VERMELHO, "Vocк nгo estб em modo admin, use /trabalhar.");
if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, -1, "Vocк nгo й admin.");
if(Login[playerid] == 0) return SendClientMessage(playerid, COR_AMARELO, "Vocк nгo estб logado.");
if(sscanf(params, "is", id, motivo))
{
SendClientMessage(playerid,-1,"Uso correto: /kick [id] [motivo]");
return true;
}
else
{
GetPlayerName(playerid,nome,sizeof(nome));
GetPlayerName(id,nome1,sizeof(nome1));
format(Str, sizeof(Str),"[ADMIN] %s kikou o player %s. Motivo: %s", nome, nome1, motivo);
SendClientMessageToAll(COR_TOMATO,Str);
format(Str1, sizeof(Str1),"Vocк kikou o player %s.", nome1);
SendClientMessage(playerid,-1,Str1);
Kick(id);
return true;
}
}
Re: [Ajuda] Comando /kick -
KlausM - 03.07.2014
PHP код:
CMD:kick(playerid, params[])
{
        new motivo[240];
        new id;
        new nome[MAX_PLAYER_NAME];
        new nome1[MAX_PLAYER_NAME];
        new Str[240];
        new Str1[240];
        if(adminstatus[playerid] == 1) return SendClientMessage(playerid, COR_VERMELHO, "Vocк nгo estб em modo admin, use /trabalhar.");
        if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, -1, "Vocк nгo й admin.");
        if(Login[playerid] == 0) return SendClientMessage(playerid, COR_AMARELO, "Vocк nгo estб logado.");
        if(sscanf(params, "is", id, motivo))
        {
            SendClientMessage(playerid,-1,"Uso correto: /kick [id] [motivo]");
            return true;
        }
        else
        {
        if(id == playerid || id == INVALID_PLAYER_ID || !IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "! Vocк nгo pode se kickar / ID Invбlido / Jogador offline");
            GetPlayerName(playerid,nome,sizeof(nome));
            GetPlayerName(id,nome1,sizeof(nome1));
            format(Str, sizeof(Str),"[ADMIN] %s kikou o player %s. Motivo: %s", nome, nome1, motivo);
            SendClientMessageToAll(COR_TOMATO,Str);
            format(Str1, sizeof(Str1),"Vocк kikou o player %s.", nome1);
            SendClientMessage(playerid,-1,Str1);
            Kick(id);
            return true;
        }
}Â
Re: [Ajuda] Comando /kick -
PT - 03.07.2014
pawn Код:
CMD:kick(playerid, params[])
{ Â
  if(Login[playerid] == 0)
    return SendClientMessage(playerid, COR_AMARELO, "Vocк nгo estб logado.");
  if(PlayerInfo[playerid][pAdmin] == 0)
    return SendClientMessage(playerid, -1, "Vocк nгo й admin.");
  if(adminstatus[playerid] == 1)
    return SendClientMessage(playerid, COR_VERMELHO, "Vocк nгo estб em modo admin, use /trabalhar.");
 Â
  if(sscanf(params, "us[128]", params[0], params[1]))
    return SendClientMessage(playerid,-1,"Uso correto: /kick [id] [motivo]");
  if(!(params[0] != playerid || params[0] != INVALID_PLAYER_ID || IsPlayerConnected(params[0])))
    return SendClientMessage(playerid, -1, "! Vocк nгo pode se kickar / ID Invбlido / Jogador offline");
 Â
  new szPT[128], nome[MAX_PLAYER_NAME], nome1[MAX_PLAYER_NAME];
  GetPlayerName(playerid,nome,sizeof(nome));
  GetPlayerName(params[0], nome1, sizeof(nome1));
  format(szPT, sizeof(szPT),"[ADMIN] %s kikou o player %s. Motivo: %s", nome, nome1, params[1]);
  SendClientMessageToAll(COR_TOMATO, szPT);
  format(szPT, sizeof(szPT), "Vocк kikou o player %s.", nome1);
  SendClientMessage(playerid, -1, szPT);
  Kick(params[0]);
  return true;
}
Re: [Ajuda] Comando /kick -
Cheleber_Pausini - 03.07.2014
Hey muito obrigado klaus, deu certo! (:
rep :b
EDIT: Obrigado tambem PT, muito mais arrumadinho o codigo (: