Small Coding Help
#4

Quote:
Originally Posted by Kingunit
Посмотреть сообщение
Use SCANF
It's sscanf.

Without sscanf:

pawn Код:
dcmd_me(const playerid, message[])
{
  if (!strlen(message)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /me [message]");
  new pnames[ MAX_PLAYER_NAME ], string[ 128 ];
  GetPlayerName( playerid, pnames, sizeof( pnames ));
  format(string, sizeof(string), "* %s %s", pnames, message );
  SendClientMessageToAll( COLOR_PINK, string );
  return 1;
}
with sscanf:
pawn Код:
dcmd_me(const playerid, message[])
{
  if(sscanf(params, "u[128]",params[0]))return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /me [message]");
  new pnames[MAX_PLAYER_NAME], string[128];
  GetPlayerName(playerid, pnames, sizeof(pnames));
  format(string, sizeof(string), "* %s %s", pnames, params[0]);
  SendClientMessageToAll(COLOR_PINK, string);
  return 1;
}
Reply


Messages In This Thread
Small Coding Help - by meD maN - 07.08.2011, 18:40
Re: Small Coding Help - by Backwardsman97 - 07.08.2011, 18:44
Re: Small Coding Help - by Kingunit - 07.08.2011, 18:48
Re: Small Coding Help - by Cypress - 07.08.2011, 19:45
Re: Small Coding Help - by Vince - 07.08.2011, 20:01
Re: Small Coding Help - by AndreT - 07.08.2011, 20:06
Re: Small Coding Help - by Cypress - 07.08.2011, 20:12
Re: Small Coding Help - by Sasino97 - 07.08.2011, 20:14
Re: Small Coding Help - by Scenario - 07.08.2011, 20:14
Re: Small Coding Help - by meD maN - 07.08.2011, 22:33

Forum Jump:


Users browsing this thread: 2 Guest(s)