SA-MP Forums Archive
dcmd not works - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: dcmd not works (/showthread.php?tid=152568)



dcmd not works - Nonameman - 04.06.2010

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?


Re: dcmd not works - Calgon - 04.06.2010

Did you add the required parts to OnPlayerCommandText?


Re: dcmd not works - Nonameman - 04.06.2010

You mean this?

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



Re: dcmd not works - Calgon - 04.06.2010

Quote:
Originally Posted by Nonameman
You mean this?

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


Re: dcmd not works - Nonameman - 04.06.2010

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


Re: dcmd not works - Calgon - 04.06.2010

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?


Re: dcmd not works - Nonameman - 04.06.2010

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


Re: dcmd not works - ViruZZzZ_ChiLLL - 04.06.2010

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;
}



Re: dcmd not works - Nonameman - 04.06.2010

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