SA-MP Forums Archive
Question - 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: Question (/showthread.php?tid=259695)



Question - itachi4x4 - 05.06.2011

How can i make a switch but with letters and not numbers?
Like
that i type /car
and then i can type /car engine or /car lights etc.. (i cant type command:car engine cuz it fucks up the pawn)
Thanks in advance



Re: Question - KoczkaHUN - 05.06.2011

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



Re: Question - itachi4x4 - 06.06.2011

Thanks but can you convert it to ZCMD?