[Include] [INC] flashcolor.inc v1.1 (SetPlayerFlashColor & SetPlayerFlashColorForAll!)
#1

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

Nice worky.
Reply
#3

nicely done!
Reply
#4

good, but natives, indentation?
Reply
#5

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

thx
Reply
#7

that's very useful , thx!
Reply
#8

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

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

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

Timer...
---
God job
Reply
#12

Thank you.
Reply
#13

add easy 5 line function KillFlashColorForAll(); ^^

nice idea!

Luxeon
Reply
#14

Nice job KIU!!
Reply
#15

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

Please answer i need help
Reply
#17

You're not using it correctly.

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

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

hwo do i make it flash for 2 names only
Reply
#20

works 100%
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)