Simple flashing color help
#1

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
Reply
#2

Thanks to (Correlli) - https://sampforum.blast.hk/showthread.php?tid=85101
Reply
#3

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
Reply
#4

Hmm someone else?
Reply
#5

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...
Reply
#6

What's wrong here:
PHP код:
forward FlashName(playerid);
public 
FlashName(playerid)
{
    new 
vFlash random(sizeof(ColorFlash));
    
SetPlayerColor(playeridColorFlash[vFlash]); // Replace the "COLOR" with your defined color.
    
return 1;

Reply
#7

Quote:
Originally Posted by Fantje
Посмотреть сообщение
What's wrong here:
PHP код:
forward FlashName(playerid);
public 
FlashName(playerid)
{
    new 
vFlash random(sizeof(ColorFlash));
    
SetPlayerColor(playeridColorFlash[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.
Reply
#8

ERROR:
PHP код:
error 035argument type mismatch (argument 2
Line:
PHP код:
SetPlayerColor(playeridColorFlash[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(playeridColorFlash[vFlash]); // Replace the "COLOR" with your defined color.
    
return 1;
}

SetTimer("FlashName"6000true); 
Reply
#9

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.
Reply
#10

Still got the error when I do this:

PHP код:
new ColorFlash[][] =
{
    
"0xFF0000FF",
    
"0xFF0000FF",
    
"0xFF0000FF"
}; 
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)