26.12.2010, 13:48
Loose intendation is caused by the location of your code. For some reason pawn is very sensitive at this.
That should work just fine.
The other error says you already have defined strtok, maybe you pasted it twice?
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
}
The other error says you already have defined strtok, maybe you pasted it twice?