[FilterScript] Blood & Damage Amount
#1

Blood & Damage Amount
About

This isn't really a filterscript, its more of 2 separate code snippets that are involved within the same system.

Blood; When you're shot or you fall anything and lose more than 25HP. You'll get 4 large spots of blood pop up on your screen (they will disappear after 2 seconds), I suppose just like in the actual game when you get that blood splatter.

Damage Amount; When you shoot a player, you'll get a textdraw come up on your screen ( just right of your player ) that says '46.00 - taken' < just an example. it will show the actual amount you have taken. you also get a little ding sound so it can alert you, this makes it very easy to find someone's hitbox.

Screen-Shots

Blood;


Damage Amount;


Code

Blood Code;

pawn Код:
#include <a_samp>

new Text:Blood1;
new Text:Blood2;
new Text:Blood3;
new Text:Blood4;

new timer;

public OnFilterScriptInit()
{
    Blood1 = TextDrawCreate(160.000000, 140.000000, "ld_dual:ex4");
    TextDrawBackgroundColor(Blood1, 255);
    TextDrawFont(Blood1, 4);
    TextDrawLetterSize(Blood1, 0.500000, 1.000000);
    TextDrawColor(Blood1, -1);
    TextDrawSetOutline(Blood1, 0);
    TextDrawSetProportional(Blood1, 1);
    TextDrawSetShadow(Blood1, 1);
    TextDrawUseBox(Blood1, 1);
    TextDrawBoxColor(Blood1, 255);
    TextDrawTextSize(Blood1, 60.000000, 60.000000);

    Blood2 = TextDrawCreate(250.000000, 200.000000, "ld_dual:ex4");
    TextDrawBackgroundColor(Blood2, 255);
    TextDrawFont(Blood2, 4);
    TextDrawLetterSize(Blood2, 0.500000, 1.000000);
    TextDrawColor(Blood2, -1);
    TextDrawSetOutline(Blood2, 0);
    TextDrawSetProportional(Blood2, 1);
    TextDrawSetShadow(Blood2, 1);
    TextDrawUseBox(Blood2, 1);
    TextDrawBoxColor(Blood2, 255);
    TextDrawTextSize(Blood2, 60.000000, 60.000000);

    Blood3 = TextDrawCreate(370.000000, 170.000000, "ld_dual:ex4");
    TextDrawBackgroundColor(Blood3, 255);
    TextDrawFont(Blood3, 4);
    TextDrawLetterSize(Blood3, 0.500000, 1.000000);
    TextDrawColor(Blood3, -1);
    TextDrawSetOutline(Blood3, 0);
    TextDrawSetProportional(Blood3, 1);
    TextDrawSetShadow(Blood3, 1);
    TextDrawUseBox(Blood3, 1);
    TextDrawBoxColor(Blood3, 255);
    TextDrawTextSize(Blood3, 60.000000, 60.000000);

    Blood4 = TextDrawCreate(330.000000, 290.000000, "ld_dual:ex4");
    TextDrawBackgroundColor(Blood4, 255);
    TextDrawFont(Blood4, 4);
    TextDrawLetterSize(Blood4, 0.500000, 1.000000);
    TextDrawColor(Blood4, -1);
    TextDrawSetOutline(Blood4, 0);
    TextDrawSetProportional(Blood4, 1);
    TextDrawSetShadow(Blood4, 1);
    TextDrawUseBox(Blood4, 1);
    TextDrawBoxColor(Blood4, 255);
    TextDrawTextSize(Blood4, 60.000000, 60.000000);
    return 1;
}

public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(amount >= 25)
    {
        TextDrawShowForPlayer(playerid, Blood1), TextDrawShowForPlayer(playerid, Blood2), TextDrawShowForPlayer(playerid, Blood3), TextDrawShowForPlayer(playerid, Blood4);
        timer = SetTimerEx("RemoveDamageDraw", 2000, true, "%d", playerid);
    } else return 0;
    return 1;
}

forward RemoveDamageDraw(playerid);
public RemoveDamageDraw(playerid)
{
    TextDrawHideForPlayer(playerid, Blood1), TextDrawHideForPlayer(playerid, Blood2), TextDrawHideForPlayer(playerid, Blood3), TextDrawHideForPlayer(playerid, Blood4);
    KillTimer(timer);
    return 1;
}

Damage Amount;

pawn Код:
#include <a_samp>

new Text:DTaken;
new timer;

public OnFilterScriptInit()
{
    DTaken = TextDrawCreate(360.000000, 260.000000, " ");
    TextDrawBackgroundColor(DTaken, 255);
    TextDrawFont(DTaken, 3);
    TextDrawLetterSize(DTaken, 0.500000, 1.000000);
    TextDrawColor(DTaken, -1);
    TextDrawSetOutline(DTaken, 1);
    TextDrawSetProportional(DTaken, 1);
    return 1;
}

public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
    PlayerPlaySound(playerid, 5201, 0, 0, 0);
    new string[35];
    format(string, sizeof(string), "%2.2f - taken", amount);
    TextDrawSetString(DTaken, string);
    TextDrawShowForPlayer(playerid, DTaken);
    timer = SetTimerEx("RemoveDamageDraw", 2000, true, "%d", playerid);
    return 1;
}


forward RemoveDamageDraw(playerid);
public RemoveDamageDraw(playerid)
{
    TextDrawHideForPlayer(playerid, DTaken);
    KillTimer(timer);
    return 1;
}
Credits

Lorenc_ for the Damage amount system, i got the idea from the /hitmarker system on his SF-CnR server.
( Join Today; Really Fun, Active Admins, Great Scripts/Scripter, 188.227.161.240:7777 )

Gho$t & blunt for helping me to test the different scripts.

The idea for the Blood Splatter didn't actually come from the SP Version of SA, i saw a video of someone dying on a roleplay server and thats where i saw it, also i wanted to use these sprites :P ( I think the server was PR-RP but i cannot be 100% sure. )
Reply
#2

Nice. I wanted to create something like this but never had the time. I wanted to do a SA:MP version of Call Of Duty's blood splatter. If you get hit in the back the splatter would be at the bottom of your screen and so on. Perhaps a version 2?
Reply
#3

GJ .. nice work !
Reply
#4

Quote:
Originally Posted by Psymetrix
Посмотреть сообщение
Nice. I wanted to create something like this but never had the time. I wanted to do a SA:MP version of Call Of Duty's blood splatter. If you get hit in the back the splatter would be at the bottom of your screen and so on. Perhaps a version 2?
Yeah, could be done by checking if a player is facing away from a player then obviously checking if the player damaged another player ...
Reply
#5

I like this very much
Suggestion: What about if you add the heliblood 0.3c particle as well?
Reply
#6

Whats the name for it ?
Reply
#7

Nice!

Reminds me of my FS I made in 0.3c, I used the text with font 1 and resized them to large size to make it look like a blood splatter. I think I can improve it now.
Reply
#8

Hmm good Imma use the blood code ^^
Reply
#9

I love the things done with the sprites. Nice work!
Reply
#10

Nice Work man, +Rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)