Command / text [text / text] [player id / all]
#1

Hello. I would do the command / command [text / text] [player id / all], but I do not know how. In addition, I would like to do in dcmd, so surely with sscanf. Please help
Reply
#2

https://sampwiki.blast.hk/wiki/Fast_Commands
Reply
#3

I looked, but there is no such /caps [on/off] [player id/all]
Reply
#4

Is this what you mean?

pawn Код:
dcmd_caps(playerid, params[])
{
  new mode[3], id, all[3];
  if (sscanf(params, "sd", mode, id))
  {
    if (sscanf(params, "ss", mode, all))
    {
      return SendClientMessage(playerid, 0xC0C0C0FF, "USE: /caps [on/off] [playerid/all]");
    }
    else if (!strcmp(mode, "off", true))
    {
      // Turn off for all
    }
    else if (!strcmp(mode, "on", true))
    {
      // Turn on for all
    }
  }
  else if (!IsPlayerConnected(playerid)) return SendClientMessage(playerid, 0xC0C0C0FF, "Player not connected");
  else if (!strcmp(mode, "off", true))
  {
    // Turn off for id
  }
  else if (!strcmp(mode, "on", true))
  {
    // Turn on for id
  }
  else return SendClientMessage(playerid, 0xC0C0C0FF, "USE: /caps [on/off] [playerid/all]");
  return 1;
}
Note: Not tested
Reply
#5

and that was /caps [player id/all] [on/off] how do I modify it?
Reply
#6

Quote:
Originally Posted by MrLeNy
and that was /caps [player id/all] [on/off] how do I modify it?
How do you mean?

My command was /caps [on/off] [playerid/all].
But do you want /caps [playerid/all] [on/off] ?
Reply
#7

yes
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)