I have one little problem so pls help.
#9

Quote:
Originally Posted by Frankox
K, is there any other way besides dcmd?
You should use dcmd + sscanf it's the best, for example:

pawn Код:
// On top:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

// OnPlayerCommandText:

public OnPlayerCommandText(playerid, cmdtext[])
{
  dcmd(adminkill,9,cmdtext);
  return 0;
}

dcmd_adminkill(playerid, params[])
{
  new otherid = strval(params);

  if(IsPlayerAdmin(playerid))
  {
    if (sscanf(params, "d", otherid))
      return SendClientMessage(playerid, 0xFFFFFF, "/adminkill playerid");

    if(!IsPlayerConnected(otherid))
      return SendClientMessage(playerid, 0xFFFFFF, "That player is not connected!");

    SetPlayerHealth(otherid, 0);
  }
  return 1;
}
You can get sscanf here: https://sampwiki.blast.hk/wiki/Sscanf
Reply


Messages In This Thread
I have one little problem so pls help. - by Frankox - 08.07.2009, 13:12
Re: I have one little problem so pls help. - by refshal - 08.07.2009, 13:21
Re: I have one little problem so pls help. - by Remba - 08.07.2009, 13:22
Re: I have one little problem so pls help. - by Frankox - 08.07.2009, 13:22
Re: I have one little problem so pls help. - by Frankox - 08.07.2009, 13:23
Re: I have one little problem so pls help. - by refshal - 08.07.2009, 13:26
Re: I have one little problem so pls help. - by Frankox - 08.07.2009, 13:39
Re: I have one little problem so pls help. - by refshal - 08.07.2009, 13:44
Re: I have one little problem so pls help. - by -Sneaky- - 08.07.2009, 14:10
Re: I have one little problem so pls help. - by Frankox - 08.07.2009, 15:45

Forum Jump:


Users browsing this thread: 3 Guest(s)