SA-MP Forums Archive
Transforming zcmd's commands to regular commands - 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: Transforming zcmd's commands to regular commands (/showthread.php?tid=208020)



Transforming zcmd's commands to regular commands - nuriel8833 - 07.01.2011

Hello
I downloaded a script which comes in zcmd's commands.
But my server is with regular commands,so I need to transform them to regular commands.
But the problem is that I don't know how.
(for example,here is one of the commands:
pawn Code:
CMD:startautorace(playerid, params[])
)

Can someone help me?
Thanks


Re: Transforming zcmd's commands to regular commands - Jochemd - 07.01.2011

Quote:
Originally Posted by Montserrat
View Post
But my server is with regular commands,so I need to transform them to regular commands.
I'm sorry? You mean to strcmp? If so,

pawn Code:
CMD:startautorace(playerid, params[])
to:

pawn Code:
if(!strcmp(cmdtext,"/startautorace",true))



Re: Transforming zcmd's commands to regular commands - HyperZ - 07.01.2011

pawn Code:
if (strcmp("/startautorace", cmdtext, true, 10) == 0)



Re: Transforming zcmd's commands to regular commands - nuriel8833 - 07.01.2011

Quote:
Originally Posted by Jochemd
View Post
I'm sorry? You mean to strcmp? If so,

pawn Code:
CMD:startautorace(playerid, params[])
to:

pawn Code:
if(!strcmp(cmdtext,"/startautorace",true))
yes strcmp
Thanks a lot to both of you!
Edit: the pawno crashes every time I am trying to compile /=


Re: Transforming zcmd's commands to regular commands - Jochemd - 07.01.2011

Show the code you've changed


Re: Transforming zcmd's commands to regular commands - nuriel8833 - 07.01.2011

pawn Code:
if(!strcmp(cmdtext,"/startautorace",true))
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, RED, "<!> You are not an administrator!");
    if(RaceBusy == 0x01 || RaceStarted == 1) return SendClientMessage(playerid, RED, "<!> There's a race currently. Wait first till race ends!");
    if(AutomaticRace == true) return SendClientMessage(playerid, RED, "<!> It's already enabled!");
    LoadRaceNames();
    LoadAutoRace(RaceNames[random(TotalRaces)]);
    AutomaticRace = true;
    SendClientMessage(playerid, GREEN, ">> You stared auto race. The filterscript will start a random race everytime the previous race is over!");
    return 1;
}



Re: Transforming zcmd's commands to regular commands - Jochemd - 07.01.2011

pawn Code:
if(RaceBusy == 0x01 || RaceStarted == 1) return SendClientMessage(playerid, RED, "<!> There's a race currently. Wait first till race ends!");
I think it's that. Probably that 0x01 is wrong, unsure though.

pawn Code:
if (strcmp("/startautorace", cmdtext, true, 10) == 0)
Why typing that long if you can simply do:
pawn Code:
if(!strcmp(cmdtext,"/startautorace",true))



Re: Transforming zcmd's commands to regular commands - Joe Staff - 07.01.2011

It's not, he put the IF statement outside of OnPlayerCommandText, I'm guessing.


Re: Transforming zcmd's commands to regular commands - nuriel8833 - 07.01.2011

With the zcmd's include the FS works perfect,I don't think its something in the script itself,maybe something that we've changed


Re: Transforming zcmd's commands to regular commands - HyperZ - 07.01.2011

Quote:
Originally Posted by Jochemd
View Post
pawn Code:
if(RaceBusy == 0x01 || RaceStarted == 1) return SendClientMessage(playerid, RED, "<!> There's a race currently. Wait first till race ends!");
I think it's that. Probably that 0x01 is wrong, unsure though.

pawn Code:
if (strcmp("/startautorace", cmdtext, true, 10) == 0)
Why typing that long if you can simply do:
pawn Code:
if(!strcmp(cmdtext,"/startautorace",true))
Im sorry, but
pawn Code:
if (strcmp("/startautorace", cmdtext, true, 10) == 0)
its not wrong, i guess.


Re: Transforming zcmd's commands to regular commands - nuriel8833 - 07.01.2011

Quote:
Originally Posted by Clive
Посмотреть сообщение
Im sorry, but bro
pawn Код:
if (strcmp("/startautorace", cmdtext, true, 10) == 0)
its not wrong, i guess.
Nope,still get crashed


Re: Transforming zcmd's commands to regular commands - HyperZ - 07.01.2011

Quote:
Originally Posted by Montserrat
Посмотреть сообщение
Nope,still get crashed
Why you want to use strcmp? use ZCMD


Re: Transforming zcmd's commands to regular commands - Toreno - 07.01.2011

Quote:
Originally Posted by Clive
Посмотреть сообщение
Why you want to use strcmp? use ZCMD
1+

You should stay with ZCMD, way better.


Re: Transforming zcmd's commands to regular commands - Kaylux - 07.01.2011

Why would you want to turn it into strcmp? Why not learn zcmd and change your scripts commands into zcmd. If you're asking here how to change commands into strcmp then I it feels like you don't know strcmp. ZCMD is far more efficient.


Re: Transforming zcmd's commands to regular commands - Scenario - 07.01.2011

You should stick with ZCMD; you will only be harming yourself going back to "strcmp".


Re: Transforming zcmd's commands to regular commands - nuriel8833 - 07.01.2011

I'll think about that,but just for learning,how can I solve this problem?


Re: Transforming zcmd's commands to regular commands - Toreno - 07.01.2011

It should work, if not.. that might happen because you didn't delete the old
dcmd(/startautorace, 10, cmdtext);

Or something is messed up there...


Re: Transforming zcmd's commands to regular commands - nuriel8833 - 08.01.2011

Quote:
Originally Posted by EliranPesahov
Посмотреть сообщение
It should work, if not.. that might happen because you didn't delete the old
dcmd(/startautorace, 10, cmdtext);

Or something is messed up there...
I deleted it..