Transforming zcmd's commands to regular commands
#1

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

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

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

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 /=
Reply
#5

Show the code you've changed
Reply
#6

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;
}
Reply
#7

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

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

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

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

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

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

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

You should stay with ZCMD, way better.
Reply
#14

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

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

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)