Compile error
#1

I wanted to create the command [/x], and now I have errors.

This is the screenshot with the errors:http://imgur.com/a/mSR9B

This is the code:
Код:
CMD:x(playerid, params[])
{
	new id, message[128], szMessage[256],sendername[25]];
	if(sscanf(params, "s[128]", message)) return SCM(playerid, COLOR_GREY, "/x [text]");
	{
		if(PlayerInfo[playerid][pAdmin] >= 1)
		{
			id = PlayerInfo[playerid][pReportAccepted];
			if(id >= 0)
			{
				format(szMessage, 256, "(/x) Admin %s: %s", GetName(playerid), message);
				SCM(id, COLOR_RED2, sMessage);
				SCM(playerid, COLOR_RED2, sMessage);
			}
		}
		else
		{
			new id2 = PlayerInfo[playerid][pReportAccepted2];
			if(id2 >= 0)
			{
				format(szMessage, 256, "(/x) Player %s: %s", GetName(playerid), message);
				SCM(id2, COLOR_RED2, sMessage);
				SCM(playerid, COLOR_RED2, sMessage);
			}
		}
	}
	return 1;
}
Can you help me please?
Reply
#2

You have an extra square bracket ']' after 'sendername[25]'.
Reply
#3

Quote:
Originally Posted by AndySedeyn
Посмотреть сообщение
You have an extra square bracket ']' after 'sendername[25]'.
I deleted the extra square bracket and I still get the errors:

error 017: undefined symbol "sendername"
error 017: undefined symbol "sMessage"
error 017: undefined symbol "sMessage"
error 017: undefined symbol "sMessage"
error 017: undefined symbol "sMessage"
Reply
#4

The errors are pretty trivial: you are using a variable which you haven't declared and you are declaring variables which aren't used.

You have multiple calls to sMessage but it's not declared. Plus, you declared sendername but aren't using it.

The sendername error isn't from the command. Can you show me the error line for that?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)