SA-MP Forums Archive
[Include] [INC] flashcolor.inc v1.1 (SetPlayerFlashColor & SetPlayerFlashColorForAll!) - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] [INC] flashcolor.inc v1.1 (SetPlayerFlashColor & SetPlayerFlashColorForAll!) (/showthread.php?tid=85101)

Pages: 1 2


[INC] flashcolor.inc v1.1 (SetPlayerFlashColor & SetPlayerFlashColorForAll!) - Correlli - 05.07.2009

Hello,

I've decided to release this include so others can use it, too.


What is it?
- It's an include which will change player's first color to second and in reverse in the amount of time you set.


How do i use it?
- Download flashcolor.inc and put it into your \pawno\include\ folder.
- Open your .pwn file and add this into your script:
pawn Code:
#include <flashcolor>
- Then add these two functions to your script:
pawn Code:
flash_OnPlayerConnect(playerid);
goes at OnPlayerConnect callback,
and:
pawn Code:
flash_OnPlayerDisconnect(playerid, reason);
goes at OnPlayerDisconnect callback.
- Add SetPlayerFlashColor/SetPlayerFlashColorForAll to your script.
- Compile your script.


Functions:

SetPlayerFlashColor(playerid, time_delay, repeat, color1, color2);
* Explanation: this function will flash player's color from color1 to color2.
* @playerid - id of the player you want set flash color.
* @time_delay - timer interval, you can set speed of changing (make sure you'll set timer_delay at least 1000
miliseconds (1 second)).
* @repeat - if you're using SetPlayerFlashColor in timer then put 0 (don't repeat), but if you're using
it at OnPlayerSpawn or any other callback like that, then set repeat to 1 (repeat).

* @color1 - color1 in hexadecimal code.
* @color2 - color2 in hexadecimal code.

SetPlayerFlashColorForAll(time_delay, repeat, color1, color2);
* Explanation: this function will flash all player's color from color1 to color2.
* @time_delay - timer interval, you can set speed of changing (make sure you'll set timer_delay at least 1000
miliseconds (1 second)).
* @repeat - if you're using SetPlayerFlashColor in timer then put 0 (don't repeat), but if you're using
it at OnPlayerSpawn or any other callback like that, then set repeat to 1 (repeat).

* @color1 - color1 in hexadecimal code.
* @color2 - color2 in hexadecimal code.

KillFlashColor(playerid);
* Explanation: this function will disable color-flashing on player.
* @playerid - id of the player you want disable color-flashing.
* Other: - this function is also used at flash_OnPlayerDisconnect callback, let it stay there, just
use it when you want to stop player's color-flashing.

Credits:
* Me (Don Correlli)


Download:
* flashcolor.inc v1.1


Re: [INC] flashcolor.inc (SetPlayerFlashColor & SetPlayerFlashColorForAll!) - refshal - 05.07.2009

Nice worky.


Re: [INC] flashcolor.inc (SetPlayerFlashColor & SetPlayerFlashColorForAll!) - [MOB]TheAgent - 05.07.2009

nicely done!


Re: [INC] flashcolor.inc (SetPlayerFlashColor & SetPlayerFlashColorForAll!) - [DrM]spatrik - 05.07.2009

good, but natives, indentation?


Re: [INC] flashcolor.inc (SetPlayerFlashColor & SetPlayerFlashColorForAll!) - Correlli - 05.07.2009

Quote:
Originally Posted by [_PGB_
Spatrik ]
good, but natives, indentation?
You can add natives yourself.


Re: [INC] flashcolor.inc (SetPlayerFlashColor & SetPlayerFlashColorForAll!) - [DrM]spatrik - 05.07.2009

thx


Re: [INC] flashcolor.inc (SetPlayerFlashColor & SetPlayerFlashColorForAll!) - Serediucr - 05.07.2009

that's very useful , thx!


Re: [INC] flashcolor.inc (SetPlayerFlashColor & SetPlayerFlashColorForAll!) - *ToM* - 05.07.2009

Nice, usefull include ! Well done mate, keep up the good work


Re: [INC] flashcolor.inc (SetPlayerFlashColor & SetPlayerFlashColorForAll!) - Correlli - 06.07.2009

Quote:
Originally Posted by enum djlobo
very usefull ,but maybe you can give me one opinion ,
i added it onplayerspawn for moderators
and it only start flashing at the second spawn
when the player spawn again flash more faster and more faster ,i try to kill the timer of the flash include when the onplayerdeath but in that way it dont even work
When you kill timer, add also this:
pawn Code:
FlashColor[playerid] = false;
Edit: I've added a new function: KillFlashColor(playerid);
Use it when you want to stop color-flashing on player.



Re: [INC] flashcolor.inc v1.1 (SetPlayerFlashColor & SetPlayerFlashColorForAll!) - Danny_Costelo - 06.07.2009

Really simple, Use one variable and a timer,but yeah, good job anyway.


Re: [INC] flashcolor.inc v1.1 (SetPlayerFlashColor & SetPlayerFlashColorForAll!) - illay - 06.07.2009

Timer...
---
God job


Re: [INC] flashcolor.inc v1.1 (SetPlayerFlashColor & SetPlayerFlashColorForAll!) - Correlli - 06.07.2009

Thank you.


Re: [INC] flashcolor.inc v1.1 (SetPlayerFlashColor & SetPlayerFlashColorForAll!) - luxeon - 06.07.2009

add easy 5 line function KillFlashColorForAll(); ^^

nice idea!

Luxeon


Re: [INC] flashcolor.inc v1.1 (SetPlayerFlashColor & SetPlayerFlashColorForAll!) - misko28 - 06.07.2009

Nice job KIU!!


Re: [INC] flashcolor.inc v1.1 (SetPlayerFlashColor & SetPlayerFlashColorForAll!) - Jokerstyle - 16.07.2009

I have a question: Iґm a noob scripter and I added this:
Код:
     if(PlayerInfo[playerid][pAdmin] < 10) return DenyMessage(playerid, 10);
	{
		SetPlayerFlashColor(playerid, 2000, 1, 0xFFFF00AA, 0x00000000);
		return 1;
	}
in OnPlayerSpawn, but it donґt works for me.


Re: [INC] flashcolor.inc v1.1 (SetPlayerFlashColor & SetPlayerFlashColorForAll!) - Jokerstyle - 17.07.2009

Please answer i need help


Re: [INC] flashcolor.inc v1.1 (SetPlayerFlashColor & SetPlayerFlashColorForAll!) - Correlli - 17.07.2009

You're not using it correctly.

Use this:
pawn Код:
if(PlayerInfo[playerid][pAdmin] < 10)
{
SetPlayerFlashColor(playerid, 2000, 1, 0xFFFF00AA, 0x00000000);
return 1;
}



Re: [INC] flashcolor.inc v1.1 (SetPlayerFlashColor & SetPlayerFlashColorForAll!) - Correlli - 17.07.2009

Quote:
Originally Posted by c0der.
Correlli I recall you making something like this in 2008 before you went inactive. Great!
True, i did it on my old account. But that version was a bit bugged so i re-coded it and re-released it.
I'm glad you like it.


Re: [INC] flashcolor.inc v1.1 (SetPlayerFlashColor & SetPlayerFlashColorForAll!) - [HKS]dlegend - 03.10.2009

hwo do i make it flash for 2 names only


Re: [INC] flashcolor.inc v1.1 (SetPlayerFlashColor & SetPlayerFlashColorForAll!) - cubaton3 - 03.10.2009

works 100%