#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;
}
#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;
}
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?
|