STRTOK TO DCMD
#1

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
Reply
#2

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

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
Reply
#4

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.
Reply
#5

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.
Reply
#6

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!
Reply
#7

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?
Reply
#8

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.
Reply
#9

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)
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)