SA-MP Forums Archive
Simple flashing color 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: Simple flashing color help (/showthread.php?tid=612316)



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(playeridColorFlash[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(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.


Re: Simple flashing color help - Fantje - 17.07.2016

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); 



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"
};