strlen problem
#1

hi guys,
I've done a new script with a /me cmd... (/me [text]), however I've a slight problem with the params...
(using zcmd)

that's the line:
pawn Код:
if(!strlen(params)) return SendClientMessage(playerid, GREY, "Command Useage: /me <text>");
I'm not sure what's wrong, however when I use "/me" without any params, it just sends "*MyName" instead of the message...
what's wrong with this?
(using zcmd, streamer, mysql and sscanf includes if that helps)..
never had that problem before...
Reply
#2

Try using: if ( isnull ( params ) ) return SendClientMessage( playerid, GREY, "Command Useage: /me <text>" );
Or show us your whole command.
Reply
#3

Quote:
Originally Posted by SmiT
Посмотреть сообщение
Try using: if ( isnull ( params ) ) return SendClientMessage( playerid, GREY, "Command Useage: /me <text>" );
Or show us your whole command.
Use this. Or if you prefer sscanf you can use:

Код:
CMD:me( playerid, params[] )
{
	new
	    variable[ 128 ];,

	if( sscanf( params, "s", variable ) ) SendClientMessage( playerid, WHITE, "[ > ]{FF7E7E} Command USAGE: /me [text]" ); // s = string, variable = variable (example: text).
	else
	{
		// code.
	}
	return true;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)