Strcmp to ZCMD
#1

Can anyone help me convert this to zcmd?

pawn Код:
if (!strcmp("car", cmdtext[1], true, 3))
{
  if (cmdtext[4] != ' ') return SendClientMessage(playerid, 0xff0000ff, "Usage: /car engine or /car lights /car whatsoever");
  if (!strcmp("engine", cmdtext[5], true, 6))
  {
    // user typed /car engine
    // put functions here
  }
  else if (!strcmp("lights", cmdtext[5], true, 6))
  {
    // user typed /car lights
    // put functions here
  }
  else if (!strcmp("boot", cmdtext[5], true, 4))
  {
    // user typed /car boot
    // put functions here
  }
  else return SendClientMessage(playerid, 0xff0000ff, "Error: unknown /car command.");
  return 1;
}
Reply
#2

CMD:car(playerid,params[])
{
//script here
//a return here
}
Reply
#3

pawn Код:
CMD:car(playerid, params[]) {
    if(strcmp(params, "engine", true) == 0) {
        // engine code
    } else if(strcmp(params, "lights", true) == 0) {
        // lights code
    } else if(strcmp(params, "boot", true) == 0) {
        // boot code
    } else return SendClientMessage(playerid, 0xff0000ff, "Error: unknown /car command.");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)