SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 05/02/2014, 06:55 PM   #1
Jstylezzz
High-roller
 
Jstylezzz's Avatar
 
Join Date: Sep 2011
Location: Netherlands
Posts: 2,973
Reputation: 1545
Default jBlood - Bloodscreen

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.*******.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!
__________________
West Side Gaming: Roleplay is looking for faction leaders/members!

WSG Discord - WSG Forum - WSG:Roleplay SA-MP Server

Working on a rewrite of the gamemode to a SampSharp version. It's starting to look very promising!

Last edited by Jstylezzz; 11/08/2015 at 08:36 PM.
Jstylezzz is offline   Reply With Quote
Old 05/02/2014, 07:10 PM   #2
iZN
High-roller
 
Join Date: Jun 2010
Posts: 2,448
Reputation: 569
Default Re: jBlood - Bloodscreen

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?
__________________
iZN is offline   Reply With Quote
Old 05/02/2014, 07:14 PM   #3
Jstylezzz
High-roller
 
Jstylezzz's Avatar
 
Join Date: Sep 2011
Location: Netherlands
Posts: 2,973
Reputation: 1545
Default Re: jBlood - Bloodscreen

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.
__________________
West Side Gaming: Roleplay is looking for faction leaders/members!

WSG Discord - WSG Forum - WSG:Roleplay SA-MP Server

Working on a rewrite of the gamemode to a SampSharp version. It's starting to look very promising!
Jstylezzz is offline   Reply With Quote
Old 06/02/2014, 12:16 AM   #4
Lordzy
High-roller
 
Join Date: Mar 2012
Location: NetherRealm
Posts: 2,763
Reputation: 1175
Default Re: jBlood - Bloodscreen

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);
__________________
Currently inactive - I don't play at any SA-MP servers nor work on anything in PAWN for now. The projects that I've done so far in PAWN, which requires updates will be taking some time.
Lordzy is offline   Reply With Quote
Old 06/02/2014, 06:35 AM   #5
Jstylezzz
High-roller
 
Jstylezzz's Avatar
 
Join Date: Sep 2011
Location: Netherlands
Posts: 2,973
Reputation: 1545
Default Re: jBlood - Bloodscreen

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'.
__________________
West Side Gaming: Roleplay is looking for faction leaders/members!

WSG Discord - WSG Forum - WSG:Roleplay SA-MP Server

Working on a rewrite of the gamemode to a SampSharp version. It's starting to look very promising!

Last edited by Jstylezzz; 06/02/2014 at 09:11 AM.
Jstylezzz is offline   Reply With Quote
Old 06/02/2014, 09:56 AM   #6
Lordzy
High-roller
 
Join Date: Mar 2012
Location: NetherRealm
Posts: 2,763
Reputation: 1175
Default Re: jBlood - Bloodscreen

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.
__________________
Currently inactive - I don't play at any SA-MP servers nor work on anything in PAWN for now. The projects that I've done so far in PAWN, which requires updates will be taking some time.
Lordzy is offline   Reply With Quote
Old 06/02/2014, 10:13 AM   #7
Kar
High-roller
 
Kar's Avatar
 
Join Date: May 2010
Location: Black Asylum
Posts: 3,184
Reputation: 506
Default Re: jBlood - Bloodscreen

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?
Y_Less's fading is still the best atm
Kar is offline   Reply With Quote
Old 06/02/2014, 12:22 PM   #8
Pottus
Godfather
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 5,420
Reputation: 1240
Default Re: jBlood - Bloodscreen

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.
Pottus is offline   Reply With Quote
Old 06/02/2014, 12:59 PM   #9
Jstylezzz
High-roller
 
Jstylezzz's Avatar
 
Join Date: Sep 2011
Location: Netherlands
Posts: 2,973
Reputation: 1545
Default Re: jBlood - Bloodscreen

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
__________________
West Side Gaming: Roleplay is looking for faction leaders/members!

WSG Discord - WSG Forum - WSG:Roleplay SA-MP Server

Working on a rewrite of the gamemode to a SampSharp version. It's starting to look very promising!
Jstylezzz is offline   Reply With Quote
Old 07/02/2014, 05:15 PM   #10
Wizz123
Big Clucker
 
Join Date: Jan 2012
Location: Wisconsin, Green Bay
Posts: 91
Reputation: 13
Default Re: jBlood - Bloodscreen

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.
__________________
Wizz123 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 08:37 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.