[HELP] Unknown server command
#8

Quote:
Originally Posted by japufta
Simple, you are never returning that the command worked in your code, all you have to do is add a "return 1;" line after every command you do is finished.

I did the /me for you:

Код:
if(strcmp(cmd, "/me", true) == 0)
{
	GetPlayerName(playerid, sendername, sizeof(sendername));
	new length = strlen(cmdtext);
	while ((idx < length) && (cmdtext[idx] <= ' '))
	{
		idx++;
	}
	new offset = idx;
	new result[64];
	while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
	{
		result[idx - offset] = cmdtext[idx];
		idx++;
	}
	result[idx - offset] = EOS;
	if(!strlen(result))
	{
		SendClientMessage(playerid, COLOR_WHITE, "USAGE: /me [action]");
		return 1;
	}
	else
	{
		format(string, sizeof(string), "* %s %s", sendername, result);
	}
	ProxDetector(30.0, playerid, string, COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY,COLOR_GREY);
    printf("%s", string);

    // You need to add this return 1, this tells the program that the command worked successfully (or something like that)
    return 1;
}
Seriously I would just use his ^^^.

The other ones are for like RPG's and I think he wants it for a RolePlay Script
Reply


Messages In This Thread
[HELP] Unknown server command - by Matthew_Murdoch - 27.08.2009, 15:17
Re: [HELP] Unknown server command - by kaisersouse - 27.08.2009, 15:18
Re: [HELP] Unknown server command - by Matthew_Murdoch - 27.08.2009, 15:44
Re: [HELP] Unknown server command - by japufta - 27.08.2009, 16:57
Re: [HELP] Unknown server command - by MenaceX^ - 27.08.2009, 17:02
Re: [HELP] Unknown server command - by Matthew_Murdoch - 27.08.2009, 17:40
Re: [HELP] Unknown server command - by Joe Staff - 27.08.2009, 18:14
Re: [HELP] Unknown server command - by NEW_IE - 27.08.2009, 18:59
Re: [HELP] Unknown server command - by japufta - 27.08.2009, 21:04

Forum Jump:


Users browsing this thread: