A /color command
#2

You need to use strcmp to get the additional two parameters, color 1 and color 2.
pawn Код:
if(strcmp(cmd, "/color", true) == 0 || strcmp(cmd, "/colour", true) == 0)
    {
      new color1, color2, tmp[256];
      tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /carcolor [color1] [color2]");
      color1 = strval(tmp);
      tmp = strtok(cmdtext, idx);
      if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /carcolor [color1] [color2]");
      color2 = strval(tmp);
      ChangeVehicleColor(GetPlayerVehicleID(playerid), color1, color2);
        return 1;
    }
Reply


Messages In This Thread
A /color command - by security - 02.09.2009, 15:55
Re: A /color command - by Clavius - 02.09.2009, 16:01
Re: A /color command - by security - 02.09.2009, 16:46
Re: A /color command - by Clavius - 02.09.2009, 17:25
Re: A /color command - by security - 02.09.2009, 18:21
Re: A /color command - by Daem - 02.09.2009, 18:47
Re: A /color command - by security - 03.09.2009, 13:45
Re: A /color command - by Clavius - 03.09.2009, 20:12

Forum Jump:


Users browsing this thread: 1 Guest(s)