dcmd not works
#1

Hey,

I made a small lotto script, using dcmd, and it worked fine when I used it as an FS.
Now, I put it into my main gamemode, and it doesn't work.
The compiler writes no errors or warnings, just when I try the '/lotto param1 param2 param3' command,
the server writes me this: "SERVER: Unknown command".
And as I said, there are no errors in it, i copied it from my FS.

Any ideas?
Reply
#2

Did you add the required parts to OnPlayerCommandText?
Reply
#3

You mean this?

Код:
dcmd(lotto, 5, cmdtext);
Reply
#4

Quote:
Originally Posted by Nonameman
You mean this?

Код:
dcmd(lotto, 5, cmdtext);
Yes.
Reply
#5

And in the FS, it works again.. I dunno what can be the problem..
Reply
#6

Quote:
Originally Posted by Nonameman
And in the FS, it works again.. I dunno what can be the problem..
So I assume you included that, or not?
Reply
#7

yes, but I deleted it from the Filterscript part of the server config file, and now it's in the gamemode
Reply
#8

pawn Код:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(command, 7, cmdtext); // the command, number of letters, cmdtext
return 0;
}

dcmd_command(playerid, params[])
{
#pragma unused params
SendClientMessage(playerid, color, "LOL");
return 1;
}
Reply
#9

ehh I have all the functions and params, that's why i asked what's wrong with it then..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)