01.07.2011, 16:03
Here is the problem :
You have to change this numbers to the length of the command's name string .
Here, it should solve your problem :
I hope that i have helped .
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/aco", cmdtext, true, 10) == 0) { SendClientMessage(playerid,0xFF0000AA,"admin color on"); SetPlayerColor(playerid,0xFF0000AA); return 1; } if (strcmp("/acoff", cmdtext, true, 10) == 0) { SetPlayerColor(playerid, 0xFFFFFFAA); return 1; } return 0; }
Here, it should solve your problem :
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/aco", cmdtext, true, 4) == 0)
{
SendClientMessage(playerid,0xFF0000AA,"admin color on");
SetPlayerColor(playerid,0xFF0000AA);
return 1;
}
if (strcmp("/acoff", cmdtext, true, 6) == 0)
{
SetPlayerColor(playerid, 0xFFFFFFAA);
return 1;
}
return 0;
}
I hope that i have helped .