Jump to content
  • 0

Problema comanda /kick


Question

Posted

Salut!Am o problema cu comanda kick !Cand vreau sa dau kick cuiva imi zice canu pot da kick  unui membru din staful meu!La orice persoana si una debea inregistrata!

if(strcmp(cmd, "/kick", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

      tmp = strtok(cmdtext, idx);

  if(!strlen(tmp))

  {

    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /kick [playerid/PartOfName] [reason]");

    return 1;

  }

  giveplayerid = ReturnUser(tmp);

  if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 3)

  {

    if(IsPlayerConnected(giveplayerid))

    {

        if(giveplayerid != INVALID_PLAYER_ID)

        {

      if (strcmp(giveplayer,"Spilter",true)==0 || strcmp(giveplayer,"Spilter",true)==0)

{

      SendClientMessage(playerid, COLOR_GRAD1, "You cannot kick the member of staff!.");

      return 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: /kick [playerid/PartOfName] [reason]");

      return 1;

      }

      new year, month,day;

      getdate(year, month, day);

      format(string, sizeof(string), "{F81414}AdmCmd: {F3FF02}%s was kicked by {FFFFFF}%s,{F81414}reason: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);

if(PlayerInfo[playerid][pAdmin] > 0)

{

  format(string, sizeof(string), "{F81414}Admin %s: {F3FF02}%s was kicked with reason:{F81414} %s",sendername,giveplayer, (result));

}

if(PlayerInfo[playerid][pHelper] > 0)

{

  format(string, sizeof(string), "{F81414}Helper %s: {F3FF02}%s was kicked with reason:{F81414} %s",sendername,giveplayer, (result));

}

  SendClientMessageToAll(COLOR_LIGHTRED, string);

      KickLog(string);

      Kick(giveplayerid);

      return 1;

    }

    }

  }

  else

  {

    format(string, sizeof(string), "  %d is not an active player.", giveplayerid);

    SendClientMessage(playerid, COLOR_GRAD1, string);

  }

  }

  return 1;

}

2 answers to this question

Recommended Posts

Posted

Pune

GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
inainte de
if (strcmp(giveplayer,"Spilter",true)==0 || strcmp(giveplayer,"Spilter",true)==0)

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.