SA-MP Forums Archive
[FilterScript] GiveDamage and TakeDamage with TextDraw and Sound - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] GiveDamage and TakeDamage with TextDraw and Sound (/showthread.php?tid=351329)



GiveDamage and TakeDamage with TextDraw and Sound - [MsT]Pho3niX - 15.06.2012

Yo people, I created this FilterScript for GM's A/D and DM

Feel free to use it! Still in BETA!
pawn Code:
#include <a_samp>

#define LGreenColor   0x00FF04FF
#define RedColor      0xE81010FF

new Text:GiveDamage[MAX_PLAYERS];
new Text:TakeDamage[MAX_PLAYERS];

public OnGameModeInit()
{
    for(new i; i < MAX_PLAYERS; ++i)
    {
    GiveDamage[i] = TextDrawCreate(171.000000, 388.000000, " ");
    TextDrawAlignment(GiveDamage[i], 2);
    TextDrawBackgroundColor(GiveDamage[i], 255);
    TextDrawFont(GiveDamage[i], 2);
    TextDrawLetterSize(GiveDamage[i], 0.160000, 0.599999);
    TextDrawColor(GiveDamage[i], 0x00FF04FF);
    TextDrawSetOutline(GiveDamage[i], 1);
    TextDrawSetProportional(GiveDamage[i], 1);
    }

    for(new i; i < MAX_PLAYERS; ++i)
    {
    TakeDamage[i] = TextDrawCreate(440.000000,388.000000, " ");
    TextDrawAlignment(TakeDamage[i], 2);
    TextDrawBackgroundColor(TakeDamage[i], 255);
    TextDrawFont(TakeDamage[i], 2);
    TextDrawLetterSize(TakeDamage[i], 0.160000, 0.599999);
    TextDrawColor(TakeDamage[i], 0xE81010FF);
    TextDrawSetOutline(TakeDamage[i], 1);
    TextDrawSetProportional(TakeDamage[i], 1);
    }
    return 1;
}

forward OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid);
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
    new s[20];
    format(s, 20, "+Damage %.0f", amount);
    TextDrawSetString(GiveDamage[playerid], s);
    TextDrawShowForPlayer(playerid, GiveDamage[playerid]);
    PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
    SetTimerEx("DestruirTextoDraw", 1000, false, "i", playerid);
    return 1;
}

forward OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid);
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    new s[20];
    format(s, 20, "-Damage %.0f", amount);
    TextDrawSetString(TakeDamage[playerid], s);
    TextDrawShowForPlayer(playerid, TakeDamage[playerid]);
    SetTimerEx("DestruirTextoDraw", 1000, false, "i", playerid);
    return 1;
}

forward DestruirTextoDraw(playerid);
public DestruirTextoDraw(playerid)
{
    TextDrawHideForPlayer(playerid, GiveDamage[playerid]);
    TextDrawHideForPlayer(playerid, TakeDamage[playerid]);
    return 1;
}
When you hit a shot or a blow, the damage will appear and give a sound of success.
/imageshack/img834/66/samp027ddh.png

When you take a shot, suffering a blow or fall, the damage appears.
/imageshack/img85/2588/samp028iwd.png
'


Re: GiveDamage and TakeDamage with TextDraw and Sound - Ades - 15.06.2012

What is the use of it?


Re: GiveDamage and TakeDamage with TextDraw and Sound - [MsT]Pho3niX - 15.06.2012

Read the description, GM's A / D and DM


Re: GiveDamage and TakeDamage with TextDraw and Sound - Ades - 15.06.2012

GameMode A/D ?

Never heard of it.


Re: GiveDamage and TakeDamage with TextDraw and Sound - iFederal - 15.06.2012

A/D - what did I just see?
Can you explain more, please?



Re: GiveDamage and TakeDamage with TextDraw and Sound - CooL_LosT - 15.06.2012

gamemodes of attack and defense, tdm, dm


Re: GiveDamage and TakeDamage with TextDraw and Sound - Shadow_ - 15.06.2012

You should of use PlayerTextDraws.

And take screenshots.


Re: GiveDamage and TakeDamage with TextDraw and Sound - [MsT]Pho3niX - 16.06.2012

Quote:
Originally Posted by iFederal
View Post
A/D - what did I just see?
Can you explain more, please?
A/D = It is a type of game mode (Attack and Defense)...
In this mode there are several game modes, like DM, which is kill them all and earn kills, or new weapons. It also has a mode, Capture the Flag, which are two teams against one another, one defends the flag to another attack, captured flag to... If in case a team kill all his enemies round ends with the title to the winning team...


Find out more about it, you'll like, I guarantee.


Re: GiveDamage and TakeDamage with TextDraw and Sound - [MsT]Pho3niX - 16.06.2012

Quote:
Originally Posted by CooL_LosT
View Post
gamemodes of attack and defense, tdm, dm
Sу para os Nices! xD HAHA'


Re: GiveDamage and TakeDamage with TextDraw and Sound - [MsT]Pho3niX - 16.06.2012

Quote:
Originally Posted by Ades
View Post
GameMode A/D ?

Never heard of it.
A/D = It is a type of game mode (Attack and Defense)...
In this mode there are several game modes, like DM, which is kill them all and earn kills, or new weapons. It also has a mode, Capture the Flag, which are two teams against one another, one defends the flag to another attack, captured flag to... If in case a team kill all his enemies round ends with the title to the winning team...