SA-MP Forums Archive
Strcmp change - 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)
+--- Thread: Strcmp change (/showthread.php?tid=559749)



Strcmp change - dundolina - 25.01.2015

Hello i have an old gamemode and i have many, many command about 200 or 300. They are strcmp format and my question is how to convert them to zcmd format? I dont found nothing on internet, please help!


Re: Strcmp change - vassilis - 25.01.2015

pawn Код:
COMMAND:MYCOMMANDNAME(playerid,params[])
{
           //addyourcode here
      return 1;
}
replace if(strcmp etc.. with CMD:commandname(playerid,params


Re: Strcmp change - dundolina - 25.01.2015

I try this way but in the code i give me errors and not compile..


Re: Strcmp change - Abagail - 25.01.2015

You can do something like:

Replace Text:
Код:
if(strcmp(cmdtext, "/"
Replace With: [code]CMD:"

and then
Replace Text:
Код:
,true))
Replace With:
Код:
(playerid,params[])
Note: that your STRCMP commands may use outdated methods such as strok, so you may want to update those commands additionally.

To bring up the replace box, press CTRL+H.


Re: Strcmp change - dundolina - 25.01.2015

How to update them?


Re: Strcmp change - Schneider - 25.01.2015

Quote:
Originally Posted by dundolina
Посмотреть сообщение
How to update them?
You could start off by just reading the comments.... 2 people already gave you the right answer...

If you are already too lazy to read the comments from Abagail and Vassilis, how on earth are you gonna convert 200/300 commands? ...and that's just the header, we haven't even mentioned all converting that needs to be done to make the commands parameters work. It's gonna take you days or even weeks.


Re: Strcmp change - dundolina - 25.01.2015

Yeah, so i cant convert them?


Re: Strcmp change - Schneider - 25.01.2015

Yes you can, but with 200/300 commands it's gonna take a very long time. But creating them should have cost you at least many months too, so I assume you can image how long converting them would take.


Re: Strcmp change - Abagail - 25.01.2015

Quote:
Originally Posted by Abagail
Посмотреть сообщение
You can do something like:

Replace Text:
Код:
if(strcmp(cmdtext, "/"
Replace With: [code]CMD:"

and then
Replace Text:
Код:
,true))
Replace With:
Код:
(playerid,params[])
Note: that your STRCMP commands may use outdated methods such as strok, so you may want to update those commands additionally.

To bring up the replace box, press CTRL+H.
This is what you need to do to do it all at once without manually going through and changing everything.


Re: Strcmp change - fonia5 - 25.01.2015

Quote:
Originally Posted by vassilis
Посмотреть сообщение
pawn Код:
COMMAND:MYCOMMANDNAME(playerid,params[])
{
           //addyourcode here
      return 1;
}
replace if(strcmp etc.. with CMD:commandname(playerid,params
That's your answer and converting will take time.