[Include] jBlood - Bloodscreen
#1

jBlood- Bloodscreen
by Jstylezzz


Introduction
  • What is this?

Hi all! I present you this all new include; jBlood! It basically shows like, that bloodstain effect on your screen and slowly fades away. I got it out of the TDM mode I'm writing, and decided it might be nice for other people out there who might want to make something similiar.
If there is anything unclear about the rest of the thread, please let me know right away.
  • Video

[ame]http://www.youtube.com/watch?v=k6UCkT0ImDs[/ame]
Usage information

  • How do I use it?
It's designed to be as small and easy as possible. There's only one function in this include, which can be used in 2 ways (since V1.1).
pawn Code:
ShowBloodScreen(int:playerid,Float:amount);
or, if you want to set a custom fadetime (V1.1 and above)
pawn Code:
ShowBloodScreen(int:playerid,Float:amount,fadetime = 100);

In this function, playerid is the id of the player the bloodscreen should be shown to, and amount is the amount of damage that was dealt. Note, that the intensity of the bloodscreen is different for each damage amount.
The parameter shadetimer is the time in milliseconds that the timer that fades the red should run on. The default is 100, and as of V1.1 you can set it yourself.

Example:
pawn Code:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    ShowBloodScreen(playerid,amount);
}
Or, using the custom shadetimer parameter (V1.1 and above)

pawn Code:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    ShowBloodScreen(playerid,amount, 150); //Change 150 to the time in milliseconds you want the fade timer to run on. The default is 100.
}
This will show the bloodscreen each time the player recieves damage.
  • Requirements
  • Installation
  • Download the include, and place it in pawno/includes
  • Add #include <jBlood> to your script. NOTE: sscanf must be included BEFORE jBlood!
Download
  • Changelog
Code:
[CHANGED]: V1.1 - ShowBloodScreen changed from public to stock, due to the fact that the default value of 'shadetimer' gives the following error when used in a public: 'function argument may not have a default value'.
[ADDED]: V1.1 - 'shadetimer' param in the ShowBloodScreen function. You can now set your own fade time. The default is 100ms. This parameter is optional, if you don't use it in the function, the default (100) will be used.
 V1.0b - Initial release
Scripts that use this include

Also used this include in a released script? Let me know, and I'll add it in this list! Might help your work to get seen if people come across this thread.
License

You are NOT allowed to re-upload or re-release this without my WRITTEN permission! Also don't claim it as your own, respect the author's work. As for the rest, you may use and modify this script as much as you wish, just leave the credits where they are.
Thanks!
Reply
#2

Good work. I used to be using Seifader ages ago for my freeroaming server, I remember. The idea was cool, but I think the idea is from Seif; isn't it?
Reply
#3

Quote:
Originally Posted by iZN
View Post
Good work. I used to be using Seifader ages ago for my freeroaming server, I remember. The idea was cool, but I think the idea is from Seif; isn't it?
Not really actually. I just needed something like those shooters out there, and thought of this.. But if there's anything out there already existing, then this is probably only for people who want to learn how to do stuff like this, because this is specifically made for that bloodscreen thingie :P
I have heard from Seifader in the past, but I haven't really got into his stuff to be honest, so I wouldn't know.
Reply
#4

Nice work but a parameter called 'shadebacktime' would have been good in getting those colors lighten in the time we specify.
pawn Code:
ShowBloodScreen(playerid,Float:amount, shadebacktime = 100);
Reply
#5

Quote:
Originally Posted by Lordz™
View Post
Nice work but a parameter called 'shadebacktime' would have been good in getting those colors lighten in the time we specify.
pawn Code:
ShowBloodScreen(playerid,Float:amount, shadebacktime = 100);
Thanks for the suggestion, I'll add that
Little question though.. Should shadebacktime be in milliseconds, or the percentage that changes the time based on the default one?
EDIT: I went with the milliseconds :P If your idea was different, tell me.

Update to V1.1

  • What's new/ what's changed?
  • 'shadetimer' param in the ShowBloodScreen function. You can now set your own fade time. The default is 100ms. This parameter is optional, if you don't use it in the function, the default (100) will be used. (Suggested by Lordz™)
  • ShowBloodScreen changed from public to stock, due to the fact that the default value of 'shadetimer' gives the following error when used in a public: 'function argument may not have a default value'.
Reply
#6

Quote:
Originally Posted by Jstylezzz
View Post
Thanks for the suggestion, I'll add that
EDIT: I went with the milliseconds :P If your idea was different, tell me.
Mine too was with milliseconds. Nice update btw.
Reply
#7

Quote:
Originally Posted by iZN
View Post
Good work. I used to be using Seifader ages ago for my freeroaming server, I remember. The idea was cool, but I think the idea is from Seif; isn't it?
******'s fading is still the best atm
Reply
#8

You only need one textdraw to do this as colors only show when you hide/show a textdraw and if you are using a textdraw for every player use player textdraws.
Reply
#9

Quote:
Originally Posted by [uL]Pottus
View Post
You only need one textdraw to do this as colors only show when you hide/show a textdraw and if you are using a textdraw for every player use player textdraws.
Thanks for the tips, will take them with me on my path of learning I have used a separate textdraw per player, as the colour is changed all the time, according to the amount of damage sent to the ShowBloodScreen function, so it's different for all players. I never used player textdraws before, so I'll get into that.

Thanks again
Reply
#10

You didn't need to make an include because of a textdraw your function only provides the playerid parameter and a timer anybody could of simply used Zamaroht's textdraw editor and set it up, as for the timer you use the SetTimerEx function and make the color transparent in every timer.
Reply
#11

Yes, but if you read the topic intro, I was working on my own things, and decided it might be usefull or nice to release. I didn't just make an include, like, just to make and release one. I just copied stuff I wrote, and put it into an include to share it.
Thanks for your reply.
Reply
#12

Nice work. Bloody screen so real!
Reply
#13

Nice Work Buddy
Reply
#14

WOAH include for that simple thing ?WTF ?Its just one simple textdraw oh.....
Reply
#15

include for one simple screen effect?
Reply
#16

Quote:
Originally Posted by Humza
View Post
include for one simple screen effect?
Yes.
Reply
#17

i like it anyways +rep ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)