chat colour change
#3

Quote:
Originally Posted by iRape
Ohhk? You just want to change your players color. (In default chat, the color of yourself will be the same when you talk too)

Simple as this.

Код:
	if(strcmp(cmd, "/changemycolour", true) == 0)
	{
SetPlayerColor(playerid, CHOOSEACOLOR);
}
		return 1;
	}
oh My God, is strtok

Here Code Strtok and Command:

pawn Код:
public OnPlayerCommandText(playerid,cmdtext[]) {
  new index, cmd[128];
  cmd = strtok(cmdtext, index);
  if (!strcmp("/color",cmd,true,6)) {
    SetPlayerColor(playerid,Color);//COLOR = COLOR
    return 1;
  }
  return 0;
}
//-----------------------------------------
strtok(const string[], &index)
{
  new length = strlen(string);
  while ((index < length) && (string[index] <= ' '))
  {
    index++;
  }
  new offset = index;
  new result[20];
  while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  {
    result[index - offset] = string[index];
    index++;
  }
  result[index - offset] = EOS;
  return result;
}
Reply


Messages In This Thread
chat colour change - by Kar - 27.05.2010, 21:23
Re: chat colour change - by omgunoobjk - 27.05.2010, 23:27
Re: chat colour change - by ipsBruno - 28.05.2010, 02:16
Re: chat colour change - by Kar - 28.05.2010, 20:42
Re: chat colour change - by (SF)Noobanatior - 28.05.2010, 20:44
Re: chat colour change - by ColdXX - 28.05.2010, 20:49
Re: chat colour change - by Kar - 28.05.2010, 20:52
Re: chat colour change - by (SF)Noobanatior - 28.05.2010, 20:59
Re: chat colour change - by ColdXX - 28.05.2010, 20:59
Re: chat colour change - by aircombat - 28.05.2010, 21:00

Forum Jump:


Users browsing this thread: 1 Guest(s)