How to get text on player command??
#4

Quote:
Originally Posted by sebacol
TNX but how can I now if someone type this: /command 1 blah blah blah blah blah

how to get this num and all that text?
You can very simply use DCMD and sscanf, which you can download from http://solidfiles.com/d/29b0aa68e078...77fd4a7cfd7c76 , put this in your pawno/include folder and on the top of fs/gm type #include <dcmd>

then OnPlayerCommandText(..), add:

Код:
dcmd(command,8,cmdtext);
And after callback OnPlayerCommandText add:


dcmd_command(playerid,params[])
{

new i, tmp[20];
if(sscanf(params,"is",i,tmp))return SendClientMessage(playerid,0xFFFFFFFF," USAGE: /command integer text");
new string[25]; format(string,sizeof(string)," Pawno gets: integer: %d, and string: %s.",i,tmp);
return SendClientMessage(playerid,0xFFFFFFFF,string);

}

Now:

i - integer (number)
s - string (text)

So you should use this command: /command 1 blahblahblah

Reply


Messages In This Thread
How to get text on player command?? - by sebacol - 13.02.2010, 20:28
Re: How to get text on player command?? - by Universal - 13.02.2010, 20:35
Re: How to get text on player command?? - by sebacol - 14.02.2010, 06:46
Re: How to get text on player command?? - by Universal - 14.02.2010, 07:04
Re: How to get text on player command?? - by sebacol - 14.02.2010, 08:51
Re: How to get text on player command?? - by adsy - 14.02.2010, 10:53
Re: How to get text on player command?? - by Universal - 14.02.2010, 11:17

Forum Jump:


Users browsing this thread: 3 Guest(s)