[FilterScript] Health Lost, Armour lost bubble over target's head
#1

This is something so simple, I wanted to make it, finally got it to work. I haven't tested it, since there is no one who's online yet on whom I can test it. Anyways, here it is.
pawn Code:
#include <a_samp>
#define COLOR_RED 0xAA3333AA
#define COLOR_GREEN 0x33AA33AA
new Text3D:Targetlabel;
new Text3D:Shooterlabel;
new DTimer;

stock GetName(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    return name;
}
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
    new Float:TargetPos[3], string[25], Float:ShooterPos[3], nstring[25];
    GetPlayerPos(issuerid, ShooterPos[0], ShooterPos[1], ShooterPos[2]);
    GetPlayerPos(playerid, TargetPos[0], TargetPos[1], TargetPos[2]);
    format(string, 25, "Lost -%f health", amount);
    format(nstring, 25, "Made %s (%d) lose -%f health!", GetName(playerid), playerid, amount);
    Targetlabel = Create3DTextLabel(string, COLOR_RED, TargetPos[0], TargetPos[1], TargetPos[2], 50.0, GetPlayerVirtualWorld(playerid), 0);
    Shooterlabel =  Create3DTextLabel(nstring, COLOR_GREEN, ShooterPos[0], ShooterPos[1], ShooterPos[2], 50.0, GetPlayerVirtualWorld(issuerid), 0);
    Update3DTextLabelText(Targetlabel, COLOR_RED, string);
    Update3DTextLabelText(Shooterlabel, COLOR_GREEN, nstring);
    Attach3DTextLabelToPlayer(Targetlabel, playerid, 0.0, 0.0, 0.3);
    Attach3DTextLabelToPlayer(Shooterlabel, issuerid, 0.0, 0.0, 0.3);
    DTimer = SetTimer("DestroyTD",3000, 0);
    return 1;
}
forward public DestroyTD();
public DestroyTD()
{
    Delete3DTextLabel(Targetlabel);
    Delete3DTextLabel(Shooterlabel);
    KillTimer(DTimer);
    return 1;
}
ScreenShot: Here is how I imagine it to be: (Yes, I know my paint skills are awesome.)

Yes, you are gonna think, is this a joke, lol.
Thanks, if there are any bugs, please do tell me!
Reply
#2

Interactive technique. Good work.

Note - That's perfect.

#March
Reply
#3

Not That good.
Try harder
But good
Reply
#4

1) You should use the native function OnPlayerTakeDamage which was made in 0.3d, which rendered wups' include useless.

2) The label stays forever. Did you even test this?

3) You can use SetPlayerChatBubble.
Reply
#5

cool
Reply
#6

Nope, please read the intro again! And yes. Sorry and thanks for your input superviper, will do the needful. Thanks everyone else.
Reply
#7

Updated with all the things except SPCB! Thanks SV. You do not need wups include or anything now!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)