Tool to convert strtok to ZCMD/sscanf
#1

Is there a tool out there that will automatically convert my commands to ZCMD/sscanf? I have a lot of commands and it will be very time consuming to do each one by one.

Or is there at least a way that I can use both zcmd and regular commands so that I can slowly convert what I need?
Reply
#2

You can use OnPlayerCommandReceived instead of OnPlayerCommandText for regular commands.
Reply
#3

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
You can use OnPlayerCommandReceived instead of OnPlayerCommandText for regular commands.
So after I include zcmd, I can just copy paste the strtok commands into OnPlayerCommandReceived and they will still be functional, as well as zcmds ?
Reply
#4

Just change the name: Text to Received
Reply
#5

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
Just change the name: Text to Received
Alright I have done this however whenever I use a command, it works, but then after it shows "SERVER: Unknown command"
Reply
#6

Change this in zcmd.inc file:

pawn Код:
if (zcmd_g_HasOPCS && !CallLocalFunction("OnPlayerCommandReceived", "is", playerid, cmdtext))
to this
pawn Код:
if (zcmd_g_HasOPCS && CallLocalFunction("OnPlayerCommandReceived", "is", playerid, cmdtext))
Reply
#7

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
Change this in zcmd.inc file:

pawn Код:
if (zcmd_g_HasOPCS && !CallLocalFunction("OnPlayerCommandReceived", "is", playerid, cmdtext))
to this
pawn Код:
if (zcmd_g_HasOPCS && CallLocalFunction("OnPlayerCommandReceived", "is", playerid, cmdtext))
Thank-you very much for your help, I really appreciate it!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)