dcmd length parameter - 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 length parameter (
/showthread.php?tid=248887)
dcmd length parameter -
MP2 - 16.04.2011
Under OnPlayerCommandText you're meant to put
dcmd(cmd, len, params)
but isn't it easier to use sizeof(cmd) instead of having a seperate length parameter? How can I do this?
Please don't recommend that I use zcmd or bcmd or fcmd of jcmd, however many different ones there are - I like dcmd. I'm not really bothered if my commands execute 0.000001 seconds faster with zcmd.
Thanks.
Re: dcmd length parameter -
iJumbo - 16.04.2011
Its only a number ... insert it ..
its easy insert a number
Re: dcmd length parameter -
Calgon - 16.04.2011
Following by [ISS]jumbo's example of:
"test" is a constant string, which means you can't dynamically get the size of it with sizeof(), especially as "test" has no identifier string at the stage of when you're inserting it in to dcmd(), don't forget - dcmd is a macro, not a proper function and it doesn't store in to a string at all.
tl;dr: No, you can't do that. That's why I'd suggest you use zcmd or another command processor, because it's a lot easier to use, and it's also faster.
Re: dcmd length parameter -
MP2 - 18.04.2011
Quote:
Originally Posted by [ISS]jumbo
Its only a number ... insert it ..
its easy insert a number
|
Nowhere in my post did I say it was DIFFICULT.