How do I set this command to a colour I want?
#1

Hey there,

I need help with this. I don't need the colour codes, but just how do I SET the text/player/team/command colour? Like this:
Код:
dcmd_banip(playerid, params[])
{
	new index = 0;
  tmp2 = strtok(params, index);
	if (pInfo[playerid][pAdmin] == 0)
	{
		SystemMessage(playerid, "You are not an Administrator.");
		return 1;
	}
  if(!strlen(tmp2))
	{
		SystemMessage(playerid, "Correct usage: '/banip [playername] [reason]'");
		return 1;
	}
	new string[MAX_STRING];
	new second, minute, hour, day, month, year;
	giveplayerid = ReturnUser(tmp2);
	if (IsPlayerConnected(giveplayerid))
	{
		format(string, sizeof(string), "You have been IP banned by Administrator %s. (Reason: '%s')", PlayerName(playerid), params);
		SendClientMessage(giveplayerid, COLOR_SYSTEM, string);
		format(string, sizeof(string), "Player %s has been IP banned by Administrator %s. (Reason: '%s')", PlayerName(giveplayerid), PlayerName(playerid), params);
		SendClientMessageToAll(COLOR_SYSTEM, string);
		format(string, sizeof(string), "%s has been IP banned by Administrator %s. (Reason: '%s')", PlayerName(giveplayerid), PlayerName(playerid), params);
		print(string);
		gettime(hour, minute, second);
		getdate(year, month, day);
		format(string,sizeof(string),"Player %s IP banned player %s on %d/%d/%d at %d:%d:%d. (Reason: '%s')", PlayerName(playerid), PlayerName(giveplayerid), month, day, year, hour, minute, second, params);
		ServerLog(string);
		BanPlayer(giveplayerid, "");
  }
  	else
  {
		SendClientMessage(playerid, COLOR_SYSTEM, "That player is not active.");
	}
  return 1;
}
It's a /banip command, default is red (I don't know why), but I want this in an other colour, how do I do that? Thanks.

A.McKinley
Reply
#2

Quote:
Originally Posted by Y_Leѕѕ
The colour is defined by your "COLOR_SYSTEM" macro, change that or use a different one.
...........How do I change that?
Reply
#3

Just put #define color_value color name , and here you can create your colors http://forum.sa-mp.com/index.php?topic=97641.0
Reply
#4

Quote:
Originally Posted by Andy_McKinley
Quote:
Originally Posted by Y_Leѕѕ
The colour is defined by your "COLOR_SYSTEM" macro, change that or use a different one.
...........How do I change that?
https://sampwiki.blast.hk/wiki/Keywordsirectives#.23define

https://sampwiki.blast.hk/wiki/Colors_Li...d_player_color

pawn Код:
#define GREEN       0x21DD00FF
for example then u can use
"GREEN" as color
so u don't need to enter those hexcodes all the time

http://www.december.com/html/spec/color.html

next time search through the wiki
Reply
#5

Does it matter WHERE I put the ''DEFINE_COLOUR''?
Reply
#6

Quote:
Originally Posted by Andy_McKinley
Does it matter WHERE I put the ''DEFINE_COLOUR''?
Yes, it does. It's best if you put if right after the include lines.
Reply
#7

Just change your
pawn Код:
SendClientMessage(giveplayerid, COLOR_SYSTEM, string);
to the color you like:

example:
pawn Код:
SendClientMessage(giveplayerid, 0x19FF00FF, string); // The 0x19FF00FF is light green

You can get the Color ID with this tool: download that: http://www.gtagarage.com/mods/show.php?id=2598

Im using such a one too. Its pretty easy.
If you have questions: ask!


Hope i helped.
Greetz, Jeffry
Reply
#8

Step one:
- Search your script for "DEFINE COLOR_SYSTEM"

Step two:
- Change the value after "SYSTEM". The value you define = New color of SystemMessage
Reply
#9

Quote:
Originally Posted by Jakku
Step one:
- Search your script for "DEFINE COLOR_SYSTEM"

Step two:
- Change the value after "SYSTEM". The value you define = New color of SystemMessage
Mine is easier!!
Reply
#10

Quote:
Originally Posted by Jeffry
Quote:
Originally Posted by Jakku
Step one:
- Search your script for "DEFINE COLOR_SYSTEM"

Step two:
- Change the value after "SYSTEM". The value you define = New color of SystemMessage
Mine is easier!!
It doesn't make the poster get it fixed, it's the quality
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)