SA-MP Forums Archive
STRTOK TO DCMD - 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: STRTOK TO DCMD (/showthread.php?tid=37035)



STRTOK TO DCMD - aroma - 12.05.2008

Hi there i have a question about my gamemode its using strtok
and i want to change it to dcmd is that alot of work or do i just need this line

#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1


Re: STRTOK TO DCMD - Brendan_Thomson - 12.05.2008

Why change? DCMD seem's like a pain in the ass.


Re: STRTOK TO DCMD - aroma - 12.05.2008

Quote:
Originally Posted by [GLRP
Brendan T ]
Why change? DCMD seem's like a pain in the ass.
Because its faster. And its true that strtok is slow i went in my own server and when i type a command. I need to wait 3 or 4 seconds when i see the command or chat

So thats why i want to change it


Re: STRTOK TO DCMD - Brendan_Thomson - 12.05.2008

For me it's dependent on my ping. My own local server it works great and fine, but if I have like a 500 ping it takes maybe half a second. 1000 maybe a second or two.


Re: STRTOK TO DCMD - Yaheli_Faro - 12.05.2008

i don't see how dmcd can be faster and if it is then it's probably only by less then a second because i saw no difference.


Re: STRTOK TO DCMD - Ignas1337 - 21.05.2009

Quote:
Originally Posted by Yaheli
i don't see how dmcd can be faster and if it is then it's probably only by less then a second because i saw no difference.
there may've been no diffrence as your script wasn't using really much memory. It IS faster with bigger scripts, but for smaller scripts it doesn't feel faster, although it IS!


Re: STRTOK TO DCMD - NovaParadox - 21.05.2009

Quote:
Originally Posted by aroma
Quote:
Originally Posted by [GLRP
Brendan T ]
Why change? DCMD seem's like a pain in the ass.
Because its faster. And its true that strtok is slow i went in my own server and when i type a command. I need to wait 3 or 4 seconds when i see the command or chat

So thats why i want to change it
3 to 4 seconds? Is your server on dial-up? My Strtok works instantaneously. What type of command is slowing it down?


Re: STRTOK TO DCMD - MenaceX^ - 21.05.2009

Quote:
Originally Posted by aroma
Quote:
Originally Posted by [GLRP
Brendan T ]
Why change? DCMD seem's like a pain in the ass.
Because its faster. And its true that strtok is slow i went in my own server and when i type a command. I need to wait 3 or 4 seconds when i see the command or chat

So thats why i want to change it
Bullshit.


Re: STRTOK TO DCMD - mamorunl - 21.05.2009

Quote:
Originally Posted by MenaceX^
Quote:
Originally Posted by aroma
Quote:
Originally Posted by [GLRP
Brendan T ]
Why change? DCMD seem's like a pain in the ass.
Because its faster. And its true that strtok is slow i went in my own server and when i type a command. I need to wait 3 or 4 seconds when i see the command or chat

So thats why i want to change it
Bullshit.
well,, it is bullshit that you want to change it for that reason because this is not caused by strtok but by your own internet connection or computer.
Quote:
Originally Posted by Brendan_Thomson
Why change? DCMD seem's like a pain in the ass.
I disagree, I really love DCMD because it is much easier to type it out instead of strtok. If you use DCMD in combination with SSCANF it is perfect and very easy if you know how it works (which I found out really quick)



Re: STRTOK TO DCMD - Badger(new) - 21.05.2009

as the others said, 3 to 4 seconds is not to do with the fact it's strtok, it's because your connection fails, either at connecting or running the server.

There's no point changing a whole script from strtok to dcmd.