Jump to content
  • 0

Question

Posted

Deci nu imi merg comenzile /kick si /ban:

30hu5cg.jpg

[pawn]  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][pStaff] >= 3)

  {

    if(IsPlayerConnected(giveplayerid))

    {

        if(giveplayerid != INVALID_PLAYER_ID)

        {

        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

      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][pStaff] > 0)

      {

        format(string, sizeof(string), "{F81414}Admin %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;

}[/pawn]

[pawn] if(strcmp(cmd, "/ban", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

    tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

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

return 1;

}

giveplayerid = ReturnUser(tmp);

if (PlayerInfo[playerid][pStaff] >= 1338)

{

    if(IsPlayerConnected(giveplayerid))

    {

        if(giveplayerid != INVALID_PLAYER_ID)

        {

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

return 1;

}

new year, month,day;

getdate(year, month, day);

format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);

BanLog(string);

format(string, sizeof(string), "AdmCmd: %s was banned by Administrator, reason: %s", giveplayer, (result));

SendClientMessageToAll(COLOR_LIGHTRED, string);

PlayerInfo[giveplayerid][pLocked] = 1;

Ban(giveplayerid);

return 1;

}

}//not connected

}

else

{

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

SendClientMessage(playerid, COLOR_GRAD1, string);

}

}

return 1;

}[/pawn]

Ce trebuie facut?

1 answer to this question

Recommended Posts

Posted

Incearca si tu sa modifici..

[pawn]

if (PlayerInfo[playerid][pStaff] >= 3)

[/pawn]

cu

[pawn]

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

[/pawn]

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.