SA-MP Forums Archive
/me, /do, /action returns if longer then 3 params - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /me, /do, /action returns if longer then 3 params (/showthread.php?tid=68431)



/me, /do, /action returns if longer then 3 params - introzen - 10.03.2009

I got those commands:

pawn Код:
dcmd_do(playerid, params[])
    {
      new action, pName[MAX_PLAYER_NAME],string[256];
      if(sscanf(params,"s",action)) return SendClientMessage(playerid,COLOR_DARKRED,"Usage: /do [action]");
      GetPlayerName(playerid,pName,sizeof(pName));
      format(string,sizeof(string),"%s ((%s))",action,pName);
      ProxDetector(25,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
      return 1;
    }
    dcmd_me(playerid, params[])
    {
      new action, pName[MAX_PLAYER_NAME],string[256];
      if(sscanf(params,"s",action)) return SendClientMessage(playerid,COLOR_DARKRED,"Usage: /me [action]");
      GetPlayerName(playerid,pName,sizeof(pName));
      format(string,sizeof(string),"%s %s",pName,action);
      ProxDetector(25,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
      return 1;
    }
  dcmd_action(playerid, params[])
    {
      new action, pName[MAX_PLAYER_NAME],string[256];
      if(sscanf(params,"s",action)) return SendClientMessage(playerid,COLOR_DARKRED,"Usage: /action [action]");
      GetPlayerName(playerid,pName,sizeof(pName));
      format(string,sizeof(string),"((%s)) %s",pName,action);
      ProxDetector(25,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
      return 1;
    }
If you type example "/me is a" it sends:

<Name> is a

if you type "/me is a jerk"

it returns 1; and sends nothing... :S Same for all those 3.. why? Plx xD


Re: /me, /do, /action returns if longer then 3 params - Dujma - 10.03.2009

You have no size on this new action

Try to put new action[64];


Re: /me, /do, /action returns if longer then 3 params - ICECOLDKILLAK8 - 10.03.2009

nvm


Re: /me, /do, /action returns if longer then 3 params - introzen - 10.03.2009

Quote:
Originally Posted by Dujma
You have no size on this new action

Try to put new action[64];
Thx