Simple flashing color help -
Fantje - 16.07.2016
I need help with something easy.
I want that you can type /vcolor and then your name color will be flashing on the map and in the chat (Flashing with 2 colours).
I know I have to use a Timer and SetPlayerColor but can you help me a bit more?
Thank you
Re: Simple flashing color help -
gurmani11 - 16.07.2016
Thanks to (Correlli) -
https://sampforum.blast.hk/showthread.php?tid=85101
Re: Simple flashing color help - WhiteGhost - 16.07.2016
Dont need an include for this.. atleast i wouldnt use it,At the end of the day its the coder who did it and his way
Re: Simple flashing color help -
Fantje - 16.07.2016
Hmm someone else?
Re: Simple flashing color help - WhiteGhost - 16.07.2016
Set a timer,make a callback in the callback set the player color randomly its that simple and that is what i would do
i would it for u but am on mobile rn sorry...
Re: Simple flashing color help -
Fantje - 16.07.2016
What's wrong here:
PHP код:
forward FlashName(playerid);
public FlashName(playerid)
{
new vFlash = random(sizeof(ColorFlash));
SetPlayerColor(playerid, ColorFlash[vFlash]); // Replace the "COLOR" with your defined color.
return 1;
}
Re: Simple flashing color help -
Flake. - 16.07.2016
Quote:
Originally Posted by Fantje
What's wrong here:
PHP код:
forward FlashName(playerid);
public FlashName(playerid)
{
new vFlash = random(sizeof(ColorFlash));
SetPlayerColor(playerid, ColorFlash[vFlash]); // Replace the "COLOR" with your defined color.
return 1;
}
|
Nothing, as long as your array that contains all the colors is fine every time FlashName is called it'll set their name color.
If your timer repeats it'll work fine.
Re: Simple flashing color help -
Fantje - 17.07.2016
ERROR:
PHP код:
: error 035: argument type mismatch (argument 2)
Line:
PHP код:
SetPlayerColor(playerid, ColorFlash[vFlash]); // Replace the "COLOR" with your defined color.
My codes:
PHP код:
new ColorFlash[][] =
{
{"#FFFFFF"},
{"#FFFFFF"},
{"#FFFFFF"}
};
forward FlashName(playerid);
public FlashName(playerid)
{
new vFlash = random(sizeof(ColorFlash));
SetPlayerColor(playerid, ColorFlash[vFlash]); // Replace the "COLOR" with your defined color.
return 1;
}
SetTimer("FlashName", 6000, true);
Re: Simple flashing color help -
Stinged - 17.07.2016
The array ColorFlash should be 1D, and not 2D.
The colour is supposed to be a hex (integer), and not a string.
Example:
0xFF0000FF is red.
Re: Simple flashing color help -
Fantje - 17.07.2016
Still got the error when I do this:
PHP код:
new ColorFlash[][] =
{
"0xFF0000FF",
"0xFF0000FF",
"0xFF0000FF"
};