DamageBar - Show damage on players head! -
Swimor - 02.02.2013
DamageBar - Show damage on players head!
version: 0.2.1
Explanation
When you damage player (armour or health) the FS will automatically create 3Dtext on players head.
After some time the text will blow up.
Screenshots
Settings
You can simply change FS settings by editing those lines:
pawn Код:
#define COLOR_BAR 0xFF0000FF // First color of 3DText
#define HEALTH_LENGTH 3 // Max langth of damage (100 is 3, 10 is 2, 1 is 1)
#define HEALTH_DRAW 30.0 // Draw distance for the 3DText
#define HEALTH_OFFSET 0.2 // First 3DText offset
#define HEALTH_OFFSETADD 0.01 // Add every update to 3D offser - commant to disable
#define COLOR_DELETE 10 // Color brightnes to delet every update
#define TIME_FIRST 400 // Time from creation to first update
#define TIME_BLOW 66 // Time from update tp update
Credits
Quote:
Thanks to:
- RaFaeL - Scripter, PAWN
- SA:MP team - SA:MP
|
Download
Pastebin -
http://pastebin.com/Wf9x4j8H
Bugs & Suggestions
Enjoy!
Re: DamageBar - Show damage on players head! -
Nautica - 02.02.2013
Hey,
This filterscript have so much Timers, he can be one timer.
I didn't like the order in which your program.
Re: DamageBar - Show damage on players head! -
Swimor - 02.02.2013
Quote:
Originally Posted by Nautica
Hey,
This filterscript have so much Timers, he can be one timer.
I didn't like the order in which your program.
|
Oh,
How you can do it with one timer without any variables? you can't.
This no meter the result is same, timer runs every time in loop. just like you want to do.
Oh yes, You can't do it with one timer becouse you must pass updated variables every time.
Re: DamageBar - Show damage on players head! -
CodyCummings - 02.02.2013
Quote:
Originally Posted by Nautica
Hey,
This filterscript have so much Timers, he can be one timer.
I didn't like the order in which your program.
|
Indeed, I had to read the code about 4 times to even grasp what was going on, once I did, I died a little inside.
Re: DamageBar - Show damage on players head! -
Nautica - 02.02.2013
pawn Код:
public OnFilterScriptInit()
{
SetTimer("MainTimer",1000,true);
return 1;
}
new Update[MAX_PLAYERS];
Update[playerid] = 400;
forward MainTimer();
public MainTimer()
{
for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
{
if(Update[i] > 1) Update[i]--;
else if(Update[i] == 00)
{
//Message....
}
}
return 1;
}
Not possible?
Re: DamageBar - Show damage on players head! -
Swimor - 02.02.2013
Quote:
Originally Posted by Nautica
pawn Код:
public OnFilterScriptInit() { SetTimer("MainTimer",1000,true); return 1; } new Update[MAX_PLAYERS]; Update[playerid] = 400;
forward MainTimer(); public MainTimer() { for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) { if(Update[i] > 1) Update[i]--; else if(Update[i] == 00) { //Message.... } } return 1; }
Not possible?
|
No, If you doing this you must add 5 variables...
Still my better :P
Re: DamageBar - Show damage on players head! -
Nautica - 02.02.2013
Quote:
Originally Posted by Swimor
No, If you doing this you must add 5 variables...
Still my better :P
|
I do not think so

You can do it in the array
Re: DamageBar - Show damage on players head! -
Alvon - 03.02.2013
Interesting technique. I greatly appreciate it. Whatever it is. Congratulations on your efforts.
Note - Simple and might be useful.
#March