SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 22/02/2013, 06:27 AM   #1
RajatPawar
High-roller
 
RajatPawar's Avatar
 
Join Date: Aug 2011
Location: ヽ༼ຈل͜ຈ༽ノ
Posts: 2,183
Reputation: 311
Default Health Lost, Armour lost bubble over target's head

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!

Last edited by RajatPawar; 23/02/2013 at 06:50 AM.
RajatPawar is offline   Reply With Quote
Old 22/02/2013, 08:30 AM   #2
Alvon
Big Clucker
 
Alvon's Avatar
 
Join Date: Jan 2013
Location: March Inc.
Posts: 60
Reputation: 3
Default Re: Health Lost, Armour lost bubble over target's head

Interactive technique. Good work.

Note - That's perfect.

#March
__________________
March Inc.

Project: AvRô Project X ϡ

★ [PDS] Pro Drift 24/7 [0.3x] ★
Developer: Threshold N Benzo.

I do not require +Rep. But if you are sincere to give. It would be greatly appreciated.
Alvon is offline   Reply With Quote
Old 22/02/2013, 01:32 PM   #3
[L4T]Left4Theft
Big Clucker
 
[L4T]Left4Theft's Avatar
 
Join Date: Oct 2012
Location: ksdrbi3.gicp.net:7778,You ?
Posts: 122
Reputation: -3
Default Re: Health Lost, Armour lost bubble over target's head

Not That good.
Try harder
But good
[L4T]Left4Theft is offline   Reply With Quote
Old 22/02/2013, 02:15 PM   #4
SuperViper
High-roller
 
SuperViper's Avatar
 
Join Date: Sep 2011
Posts: 1,178
Reputation: 315
Default Re: Health Lost, Armour lost bubble over target's head

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.
__________________
Release NameUse
FairPlayKeep the cheaters out of your server
Object Model ArrayArray of every single object model in the game
RCON PanelControl any server as you like with RCON controls
SlopeClimb up a steep hill against other players with cars falling down

I do not play on any SAMP server. Anyone with the name Ricky Phelps in-game is an imposter.
SuperViper is offline   Reply With Quote
Old 22/02/2013, 03:34 PM   #5
LavaHDProkiller
Little Clucker
 
Join Date: Jan 2013
Posts: 42
Reputation: 16
Default Re: Health Lost, Armour lost bubble over target's head

cool
__________________
Join cops and robbers server LSRCR join.

ip: 217.23.8.199:7777
LavaHDProkiller is offline   Reply With Quote
Old 22/02/2013, 03:45 PM   #6
RajatPawar
High-roller
 
RajatPawar's Avatar
 
Join Date: Aug 2011
Location: ヽ༼ຈل͜ຈ༽ノ
Posts: 2,183
Reputation: 311
Default Re: Health Lost, Armour lost bubble over target's head

Nope, please read the intro again! And yes. Sorry and thanks for your input superviper, will do the needful. Thanks everyone else.
RajatPawar is offline   Reply With Quote
Old 23/02/2013, 06:49 AM   #7
RajatPawar
High-roller
 
RajatPawar's Avatar
 
Join Date: Aug 2011
Location: ヽ༼ຈل͜ຈ༽ノ
Posts: 2,183
Reputation: 311
Default Re: Health Lost, Armour lost bubble over target's head

Updated with all the things except SPCB! Thanks SV. You do not need wups include or anything now!
RajatPawar 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
[Include] OWN3D Anticheat - Health/Armour/Money/Weapons/Vehicle Health (W.I.P) MW2_OWN3D Includes 8 14/11/2011 07:05 PM
[FilterScript] [FS]AllBar (Health Bar, Armour Bar, Vehicle Health Bar!) YmOn Filterscripts 28 03/11/2010 04:49 PM
How to make Text bubble on Head on a Admin [WSM]Deadly_Evil Help Archive 3 13/02/2010 07:15 AM
need help im lost [MWRP]Gepo_Tice Help Archive 6 03/10/2009 07:26 PM
I'm lost, lil help please? Guns_N_Roses Help Archive 8 21/02/2009 06:35 PM


All times are GMT. The time now is 12:01 AM.


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