SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 06/03/2016, 06:26 PM   #1
Crayder
High-roller
 
Crayder's Avatar
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,852
Reputation: 585
Default Blood splatter from gunshots!

Blood Splatter!

This script will change gunshots forever. Using ColAndreas and some simple math this script will splatter blood in the direction of the gunshots. The distance varies between 0 and 5. When the distance is 0 the blood will obviously go no where. When it is 1 - 5 it will splatter on any wall beyond the player being shot. The blood fades away within 2 seconds after it is splattered.
__________________________________________________ __________________________________________________

Screenshots:




__________________________________________________ __________________________________________________

Changelog:
  • 1.0.1 - Initial Release
  • 1.0.2 - Timer Optimization
  • 1.0.3 - Normal Leveling (produces random difference from the walls to prevent texture overlapping)
  • 1.0.4 - Removes y_iterate and blood limit.
  • 1.0.5 - Return value in ONWS to allow damage.
__________________________________________________ __________________________________________________

Requirements:
  • ColAndreas thanks to Pottus, Chris, and Slice (ColAndreas is the center of this FS).
  • Streamer, thanks to Incognito (using streamer since bullets shoot fast, there will be hundreds of blood objects).
  • FloatRand, thanks to Y-Less (better than my float random function).
  • *Removed*y_iterate, thanks to Y-Less (using y_iterate to handle the streamer ID's so we don't need gigantic, inefficient methods).
__________________________________________________ __________________________________________________

Bugs, Concerns, and Questions:
  • Streaming based on player movement will make it look weird. To fix, change the streamer update mode in your gamemode.
  • The ColAndreas world is based on YOUR world. For this script to work you need to have a world to begin with, if you use the San Andreas map (of course most of you do) just do CA_Init in your gamemode.
  • The blood isn't showing sometimes? It's random. It's a 5 out of 11 chance of being splattered. And as noted in the description, those 5 chances represent distances (if it's a 1, the blood will only splatter 1 unit away; 5, 5 units; and all those in between).
__________________________________________________ __________________________________________________

BloodSplatter 1.0.5
__________________
Those who deserve reputation, do not need to beg for it.
Also, don't expect the help you need when offering reputation, you'll just be attracting Rep Hunters.
Join SA-MP Discord!

Last edited by Crayder; 17/07/2016 at 10:03 PM.
Crayder is offline   Reply With Quote
Old 06/03/2016, 06:27 PM   #2
Crystallize
High-roller
 
Join Date: Aug 2013
Posts: 1,535
Reputation: 308
Default Re: Blood splatter from gunshots!

Yet an amazing release from you crayder , that's a great use of ColAndreas.
Crystallize is offline   Reply With Quote
Old 06/03/2016, 06:54 PM   #3
Pottus
Godfather
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 5,313
Reputation: 1186
Default Re: Blood splatter from gunshots!

You can do this without the need for any variables at all actually do it like this.

Code:
forward FadeBlood(objectid, alpha, time);
public FadeBlood(objectid, alpha, time)
{
    alpha -= 5;
    if(alpha) {
        SetDynamicObjectMaterial(objectid, 0, -1, "none", "none", 0xFF0000 | (alpha << 24));
        SetTimerEx("FadeBlood", time, false, "iii", objectid, alpha, time);
    }
	else {
        DestroyDynamicObject(objectid);
    }
}
Pottus is offline   Reply With Quote
Old 06/03/2016, 07:02 PM   #4
Stones
Huge Clucker
 
Stones's Avatar
 
Join Date: Jun 2013
Location: United Kingdom
Posts: 249
Reputation: 56
Default Re: Blood splatter from gunshots!

Oh wow, nice one mate, i'll be using this
__________________
Stones is offline   Reply With Quote
Old 06/03/2016, 08:11 PM   #5
Crayder
High-roller
 
Crayder's Avatar
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,852
Reputation: 585
Default Re: Blood splatter from gunshots!

Quote:
Originally Posted by Pottus View Post
You can do this without the need for any variables at all actually do it like this.

Code:
forward FadeBlood(objectid, alpha, time);
public FadeBlood(objectid, alpha, time)
{
    alpha -= 5;
    if(alpha) {
        SetDynamicObjectMaterial(objectid, 0, -1, "none", "none", 0xFF0000 | (alpha << 24));
        SetTimerEx("FadeBlood", time, false, "iii", objectid, alpha, time);
    }
	else {
        DestroyDynamicObject(objectid);
    }
}
Yeah but what's the harm in two variables in a super small filterscript...?

Still no problem, will do (edit; done in 1.0.1).

__________________________


v1.0.2: Normal leveling to prevent texture overlapping.
__________________
Those who deserve reputation, do not need to beg for it.
Also, don't expect the help you need when offering reputation, you'll just be attracting Rep Hunters.
Join SA-MP Discord!
Crayder is offline   Reply With Quote
Old 06/03/2016, 09:05 PM   #6
CounterTDM
Little Clucker
 
Join Date: Jul 2015
Location: United Kingdom
Posts: 30
Reputation: 0
Default Re: Blood splatter from gunshots!

Excellent, I will definitely be implementing this. Thanks!
CounterTDM is offline   Reply With Quote
Old 06/03/2016, 10:58 PM   #7
Pottus
Godfather
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 5,313
Reputation: 1186
Default Re: Blood splatter from gunshots!

Well you really don't need the iterator or any variables actually just supply the object id instead of index.
Pottus is offline   Reply With Quote
Old 06/03/2016, 11:02 PM   #8
Crayder
High-roller
 
Crayder's Avatar
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,852
Reputation: 585
Default Re: Blood splatter from gunshots!

Quote:
Originally Posted by Pottus View Post
Well you really don't need the iterator or any variables actually just supply the object id instead of index.
The point of the iterator is to limit the number of blood objects there can be.
__________________
Those who deserve reputation, do not need to beg for it.
Also, don't expect the help you need when offering reputation, you'll just be attracting Rep Hunters.
Join SA-MP Discord!
Crayder is offline   Reply With Quote
Old 06/03/2016, 11:06 PM   #9
Pottus
Godfather
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 5,313
Reputation: 1186
Default Re: Blood splatter from gunshots!

You don't need to worry about limiting them though since they disappear pretty quickly.
Pottus is offline   Reply With Quote
Old 06/03/2016, 11:11 PM   #10
Crayder
High-roller
 
Crayder's Avatar
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,852
Reputation: 585
Default Re: Blood splatter from gunshots!

Quote:
Originally Posted by Pottus View Post
You don't need to worry about limiting them though since they disappear pretty quickly.
Point taken. I have a feeling a lot of people are going to complain about ackslimit crashes...

I'm going to make them stay solid for a second before fading too. Like the ones in GTA (the ones that go on the ground when you are shot).
__________________
Those who deserve reputation, do not need to beg for it.
Also, don't expect the help you need when offering reputation, you'll just be attracting Rep Hunters.
Join SA-MP Discord!
Crayder 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How many would there be blood xmy1229 Everything and Nothing 2 03/04/2015 05:04 AM
Blood. audriuxxx Scripting Help 1 06/03/2013 08:14 PM
Black Blood Th0R Screenshots and Videos 3 07/04/2012 07:49 PM
[AD:RP] Og Loc - One Blood Ricop522 Screenshots and Videos 4 08/08/2011 11:47 AM
First Blood BlackWolf120 Help Archive 2 28/01/2011 07:29 PM


All times are GMT. The time now is 11:46 AM.


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