Message to all players when doing /ban
#2

You have to use

Код:
ID = ReturnUser(cmdtext[6]);
And at the
Код:
format(str, 64, "%s has been banned from the server for: %s", pName,rest);
Take the ",rest" out.
Here is the code, i think it should work
pawn Код:
else if(strcmp(cmdtext, "/ban", true, 5)==0)
{
  if(!IsPlayerAdmin(playerid)) return 0;
  if(!strlen(cmdtext[6]))
  {
    SendClientMessage(playerid, COLOR_ORED, "Usage: /ban [playerid] [reason]");
    return 1;
  }
  new ID = ReturnUser(cmdtext[6]);
  new pName[24], str[64];
  if(IsPlayerConnected(ID))
  {
    GetPlayerName(ID, pName, 24);
    format(str, 64, "%s has been banned from the server for: ", pName);
    SendClientMessageToAll(COLOR_ORED, str);
    print("Player banned");
    Ban(ID);
  }
  return 1;
}
Reply


Messages In This Thread
- - by Jakku - 11.05.2009, 16:11
Re: Message to all players when doing /ban - by matrix_smq - 11.05.2009, 16:18
Re: Message to all players when doing /ban - by Jakku - 11.05.2009, 16:22
Re: Message to all players when doing /ban - by Jakku - 11.05.2009, 16:25
Re: Message to all players when doing /ban - by matrix_smq - 11.05.2009, 16:45
Re: Message to all players when doing /ban - by Jakku - 11.05.2009, 16:47

Forum Jump:


Users browsing this thread: 1 Guest(s)