2 Problems and 1 Question
#2

Loose intendation is caused by the location of your code. For some reason pawn is very sensitive at this.
pawn Код:
#include <a_samp>
#include <sscanf2>


public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print("Colour System");
    print("--------------------------------------\n");
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
      if(strcmp("/color", cmdtext, true, 6) == 0)
      {
              new _red, _green, _blue;
              if(sscanf(cmdtext[6], "iii", _red, _green, _blue)) {
                   SendClientMessage(playerid, 0xFFFFFFAA, "USAGE: /color <red> <green> <blue> (0 - 255)");
                   return 1;
              }
              if((255 < _red < 0) || (255 < _green < 0) || (255 < _blue < 0)) {
                   SendClientMessage(playerid, 0xFFFFFFAA, "ERROR: Only from 0 till 255!");
                   return 1;
              }
              new string[32];
              _blue = ((_red << 16) | (_green << 8) | _blue);
              format(string, sizeof string, "Color changed to {%06x}%06x", _blue, _blue);
              SendClientMessage(playerid, 0xFFFFFFAA, string);
              SetPlayerColor(playerid, ((_blue << 8) | 0xFF));
              return 1;
    }
    return 0;    //Line 33
}
That should work just fine.

The other error says you already have defined strtok, maybe you pasted it twice?
Reply


Messages In This Thread
2 Problems and 1 Question - by knackworst - 26.12.2010, 13:44
Re: 2 Problems and 1 Question - by hanzen - 26.12.2010, 13:48
Re: 2 Problems and 1 Question - by knackworst - 26.12.2010, 14:04
Re: 2 Problems and 1 Question - by Nero_3D - 26.12.2010, 15:11
Re: 2 Problems and 1 Question - by Mean - 26.12.2010, 16:48
Re: 2 Problems and 1 Question - by knackworst - 26.12.2010, 22:53
Re: 2 Problems and 1 Question - by Nero_3D - 27.12.2010, 11:47

Forum Jump:


Users browsing this thread: 1 Guest(s)