help :)
#4

Use sscanf.

pawn Код:
dcmd_kick(playerid, params[])
{
  new otherid, reason[128];
  if(sscanf(params,"ds",otherid,reason))
  {
    SendClientMessage(playerid, COLOR_WHITE, "[USAGE] : /kick [playerid] [reason]");
    return 1;
  }
  if(dini_Int(GetPlayerPath(playerid), "admin") < 3)
  {
    SendClientMessage(playerid, COLOR_WHITE, "You dont have permission to access this command!");
    return 1;
  }
  if(!IsPlayerConnected(otherid))
  {
    SendClientMessage(playerid, COLOR_WHITE, "That player is not online!");
    return 1;
  }
  new player[24],admin[24],string[128];
  GetPlayerName(otherid, player, 24);
  GetPlayerName(playerid, admin, 24);
  format(string, 128, "Administrator %s kicked %s (Reason: %s)", admin, player, reason);
  SendClientMessageToAll(COLOR_WHITE, string);
  Kick(otherid);
  return 1;
}
Makes it much easier and less code.
Reply


Messages In This Thread
help :) - by Anwix - 24.04.2009, 23:31
Re: help :) - by Joe Staff - 24.04.2009, 23:47
Re: help :) - by Anwix - 24.04.2009, 23:52
Re: help :) - by Backwardsman97 - 25.04.2009, 00:09
Re: help :) - by Anwix - 25.04.2009, 00:26

Forum Jump:


Users browsing this thread: 1 Guest(s)