25.02.2012, 22:26
Blood & Damage Amount
AboutThis 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;
}
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. )