SA-MP Forums Archive
little help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: little help (/showthread.php?tid=595955)



little help - RaajParker - 10.12.2015

E:\samp\filterscripts\randomchat.pwn(62) : error 017: undefined symbol "color"

Code :
SendClientMessageToAll(color, string);


Re: little help - thefirestate - 10.12.2015

Put an actual color code instead of the word "color" or use -1 to make it white.


Re: little help - feedme - 10.12.2015

You have to define colors, when you want to use them.

#define COLOR_BLUE 0xFF0000FF

SendClientMessageToAll(COLOR_BLUE, "Test");

or you just use the ColorCode directly:

SendClientMessageToAll(0xFF0000FF, "Text");

Or just white (unformated):

SendClientMessageToAll(-1, "Text");


Re: little help - RaajParker - 10.12.2015

Quote:
Originally Posted by feedme
Посмотреть сообщение
You have to define colors, when you want to use them.

#define COLOR_BLUE 0xFF0000FF

SendClientMessageToAll(COLOR_BLUE, "Test");

or you just use the ColorCode directly:

SendClientMessageToAll(0xFF0000FF, "Text");

Or just white (unformated):

SendClientMessageToAll(-1, "Text");
Код:
#define FILTERSCRIPT //////////////////////////////////////////////////////

#include <a_samp> // SAMP standart include
#pragma tabsize 0
#define red "{FF002B}"
#define pink "{FF00D9}"
#define purple "{DFA7F2}"
#define blue "{A1C2FF}"
#define green "{3DE3B1}"
#define yellow "{FAF623}"
#define black "{69670C}"
#define orange "{F2C80C}"
#define ice "{03F2FF}"
#define lime "{00FF40}"
static title[][10] =
{
""#red"",
""#pink"",
""#purple"",
""#blue"",
""#green"",
""#yellow"",
""#black"",
""#orange"",
""#ice"",
""#lime""
};
static message[][9] =
{
""#red"",
""#pink"",
""#purple"",
""#blue"",
""#green"",
""#yellow"",
""#black"",
""#orange"",
""#ice"",
""#lime""
};
static id[][9] =
{
""#red"",
""#pink"",
""#purple"",
""#blue"",
""#green"",
""#yellow"",
""#black"",
""#orange"",
""#ice"",
""#lime""
};

public OnPlayerText(playerid, text[])
{
    // Make the changes according you like. I did this on my script as I like
    new rand = random(sizeof(title)); // Random from array 'title'
    new rand2 = random(sizeof(id)); // Random from array 'id'
    new rand3 = random(sizeof(message)); // Random from array 'message'
    static name[MAX_PLAYER_NAME],string[128]; // Defining the 'string' and the 'name'
	GetPlayerName(playerid,name,sizeof(name)); // Here, we get the player name
	format(string,sizeof(string),"%s%s %s(%d): %s%s",title[rand][0],name,id[rand2][0],playerid,message[rand3][0],text); // formating the string which will be sent
	SendClientMessageToAll(color, string); // Here we send the string for all :P
        return 0; // Dont forget that
}
see this


Re: little help - feedme - 10.12.2015

you still use color instead of any color you defined before.

SendClientMessageToAll(red, string);

should work for example