Stuck at sscanf (again)
#2

pawn Код:
CMD:message(playerid,params[])
{
    new messagetext[128], string1[128];
    if(sscanf(params, "s[128]", messagetext)) return SendClientMessage(playerid, -1, "Usage: /message [text]");
    format(string1,sizeof(string1),"%s",messagetext);
    return 1;
}
I'll explain it a bit. The sscanf checks if the params of the command is a string, of which is the messagetext, and if not, it sends a message saying how to use it. If it is, it continues, obviously, and formats it into a string. Thats all I wrote on there, considering you didn't explain what else you wanted in there, such as a playerid or something.

Hope I helped (this should work, didn't test, but no warnings/errors in compile).
Reply


Messages In This Thread
Stuck at sscanf (again) - by HDFord - 10.05.2012, 20:36
Re: Stuck at sscanf (again) - by Kindred - 10.05.2012, 20:45
Re: Stuck at sscanf (again) - by -Prodigy- - 10.05.2012, 20:45
Re: Stuck at sscanf (again) - by HDFord - 10.05.2012, 20:49
Re: Stuck at sscanf (again) - by 2KY - 10.05.2012, 20:52
Re: Stuck at sscanf (again) - by Leo Delvecchio - 10.05.2012, 20:56
Re: Stuck at sscanf (again) - by Biesmen - 10.05.2012, 20:56
Re: Stuck at sscanf (again) - by HDFord - 10.05.2012, 21:01

Forum Jump:


Users browsing this thread: 1 Guest(s)