[FilterScript] DAMAGE TEXTDRAW
#1

DAMAGE TEXTDRAW

Fiz esse textdraw o mas completo possнvel, Ele mostra o dano que acertou/levou, a arma e o player que acertou. Venho disponibilizar aqui e atй melhora-lo para uma nova versгo.


#include < a_samp >

new Text:Atingir[MAX_PLAYERS];
new Text:Atingido[MAX_PLAYERS];

new TempoMostrarLife[MAX_PLAYERS];
new MostrandoVida[MAX_PLAYERS];


new TempoMostrarLife2[MAX_PLAYERS];
new MostrandoVida2[MAX_PLAYERS];

stock PlayerName(playerid)
{
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
return Name;
}

new WeaponNames[55][] =
{
{"Punch"},{"Brass Knuckles"},{"Golf Club"},{"Nite Stick"},{"Knife"},{"Baseball Bat"},{"Shovel"},{"Pool Cue"},{"Katana"},{"Chainsaw"},{"Purple Dildo"},
{"Smal White Vibrator"},{"Large White Vibrator"},{"Silver Vibrator"},{"Flowers"},{"Cane"},{"Grenade"},{"Tear Gas"},{"Molotov Cocktail"},
{""},{""},{""}, // Empty spots for ID 19-20-21 (invalid weapon id's)
{"Colt"},{"Silenced 9mm"},{"Deagle"},{"Shotgun"},{"Sawn-off"},{"Combat"},{"Micro SMG"},{"MP5"},{"AK-47"},{"M4"},{"Tec9"},
{"Rifle"},{"Sniper"},{"Rocket"},{"HS Rocket"},{"Flamethrower"},{"Minigun"},{"Satchel Charge"},{"Detonator"},
{"Spraycan"},{"Fire Extinguisher"},{"Camera"},{"Nightvision Goggles"},{"Thermal Goggles"},{"Parachute"}, {"Fake Pistol"},{""}, {"Vehicle"}, {"Helicopter Blades"},
{"Explosion"}, {""}, {"Drowned"}, {"Collision"}
};


public OnFilterScriptInit()
{
for(new i; i < MAX_PLAYERS; ++i)
{
Atingir[i] = TextDrawCreate(168.000000,319.000000, " ");
TextDrawColor(Atingir[i], 0x33FF10AA);
TextDrawBackgroundColor(Atingir[i], 255);
TextDrawFont(Atingir[i], 2);
TextDrawSetProportional(Atingir[i], 1);
TextDrawLetterSize(Atingir[i], 1.000000,2.699999);
TextDrawSetOutline(Atingir[i], 1);
TextDrawAlignment(Atingir[i], 2);

Atingido[i] = TextDrawCreate(168.000000,319.000000, " ");
TextDrawColor(Atingido[i], 0xFF0026AA);
TextDrawBackgroundColor(Atingido[i], 255);
TextDrawFont(Atingido[i], 2);
TextDrawSetProportional(Atingido[i], 1);
TextDrawLetterSize(Atingido[i], 1.000000,2.699999);
TextDrawSetOutline(Atingido[i], 1);
TextDrawAlignment(Atingido[i], 2);
}
return 1;
}
main()
{
print("|---------------------------------------|");
print("| FS DANO |");
print("|---------------------------------------|");


}



public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{

if (issuerid != INVALID_PLAYER_ID)
{
new str[1500];
new Float:life, Float:colete, Float:totallife;
GetPlayerHealth(playerid, Float:life);
GetPlayerArmour(playerid, Float:colete);
totallife = life + colete;
KillTimer(TempoMostrarLife2[playerid]);
TextDrawShowForPlayer(playerid, Atingido[playerid]);
format(str,sizeof(str),"~r~~H~~H~%s ~w~-%.0f ~r~~h~~H~(%s) ~w~(%.0f)", PlayerName(issuerid), amount, WeaponNames[weaponid], floatround(totallife));
TextDrawSetString(Atingido[playerid], str);
TempoMostrarLife2[playerid] = SetTimerEx("HideTextoLife2", 3000, 0, "i", playerid);
MostrandoVida2[playerid] = 1;

KillTimer(TempoMostrarLife[issuerid]);
TextDrawShowForPlayer(issuerid, Atingir[issuerid]);
format(str,sizeof(str),"~g~~h~~h~%s ~w~-%.0f ~g~~h~~h~(%s) ~w~(%.0f)", PlayerName(playerid), amount, WeaponNames[weaponid], floatround(totallife));
TextDrawSetString(Atingir[issuerid], str);
TempoMostrarLife[issuerid] = SetTimerEx("HideTextoLife", 3000, 0, "i", issuerid);
MostrandoVida[issuerid] = 1;
PlayerPlaySound(issuerid , 17802, 0.0, 0.0, 0.0);
}
return 1;
}

forward HideTextoLife(playerid);
public HideTextoLife(playerid)
{
if(MostrandoVida[playerid] == 1)
{
TextDrawHideForPlayer(playerid, Atingir[playerid]);
MostrandoVida[playerid] = 0;
}
return 1;
}

forward HideTextoLife2(playerid);
public HideTextoLife2(playerid)
{
if(MostrandoVida2[playerid] == 1)
{
TextDrawHideForPlayer(playerid, Atingido[playerid]);
MostrandoVida2[playerid] = 0;
}
return 1;
}
Reply
#2

Nice job but add a pastebin link or add [PAWN] before your pawn code and after that [/ PAWN] but you must delete space between / And PAWN.
Reply
#3

Some pictures and a freakin' english presentation would be nice...
Reply
#4

What a hell is that
add <
[PAWN] CODES[/ PAWN]
Reply
#5

Ugly Filterscript Topic.


- Use
Код:
[pawn]thecodehere[/ pawn]
nextime instead of pasting all the codes into the topic "Well it's hard for some people to check the filterscript.Even no screenshots added.
Reply
#6

Or use pastebin...
Reply
#7

pawn Код:
// made by DokyPWN

#include < a_samp >

new Text:Atingir[MAX_PLAYERS];
new Text:Atingido[MAX_PLAYERS];

new TempoMostrarLife[MAX_PLAYERS];
new MostrandoVida[MAX_PLAYERS];


new TempoMostrarLife2[MAX_PLAYERS];
new MostrandoVida2[MAX_PLAYERS];

stock PlayerName(playerid)
{
    new Name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
    return Name;
}

new WeaponNames[55][] =
{
    {"Punch"},{"Brass Knuckles"},{"Golf Club"},{"Nite Stick"},{"Knife"},{"Baseball Bat"},{"Shovel"},{"Pool Cue"},{"Katana"},{"Chainsaw"},{"Purple Dildo"},
    {"Smal White Vibrator"},{"Large White Vibrator"},{"Silver Vibrator"},{"Flowers"},{"Cane"},{"Grenade"},{"Tear Gas"},{"Molotov Cocktail"},
    {""},{""},{""}, // Empty spots for ID 19-20-21 (invalid weapon id's)
    {"Colt"},{"Silenced 9mm"},{"Deagle"},{"Shotgun"},{"Sawn-off"},{"Combat"},{"Micro SMG"},{"MP5"},{"AK-47"},{"M4"},{"Tec9"},
    {"Rifle"},{"Sniper"},{"Rocket"},{"HS Rocket"},{"Flamethrower"},{"Minigun"},{"Satchel Charge"},{"Detonator"},
    {"Spraycan"},{"Fire Extinguisher"},{"Camera"},{"Nightvision Goggles"},{"Thermal Goggles"},{"Parachute"}, {"Fake Pistol"},{""}, {"Vehicle"}, {"Helicopter Blades"},
    {"Explosion"}, {""}, {"Drowned"}, {"Collision"}
};


public OnFilterScriptInit()
{
    for(new i; i < MAX_PLAYERS; ++i)
    {
        Atingir[i] = TextDrawCreate(168.000000,319.000000, " ");
        TextDrawColor(Atingir[i], 0x33FF10AA);
        TextDrawBackgroundColor(Atingir[i], 255);
        TextDrawFont(Atingir[i], 2);
        TextDrawSetProportional(Atingir[i], 1);
        TextDrawLetterSize(Atingir[i], 1.000000,2.699999);
        TextDrawSetOutline(Atingir[i], 1);
        TextDrawAlignment(Atingir[i], 2);

        Atingido[i] = TextDrawCreate(168.000000,319.000000, " ");
        TextDrawColor(Atingido[i], 0xFF0026AA);
        TextDrawBackgroundColor(Atingido[i], 255);
        TextDrawFont(Atingido[i], 2);
        TextDrawSetProportional(Atingido[i], 1);
        TextDrawLetterSize(Atingido[i], 1.000000,2.699999);
        TextDrawSetOutline(Atingido[i], 1);
        TextDrawAlignment(Atingido[i], 2);
    }
    return 1;
}

public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if (issuerid != INVALID_PLAYER_ID)
    {
        new str[1500];
        new Float:life, Float:colete, Float:totallife;
        GetPlayerHealth(playerid, Float:life);
        GetPlayerArmour(playerid, Float:colete);
        totallife = life + colete;
        KillTimer(TempoMostrarLife2[playerid]);
        TextDrawShowForPlayer(playerid, Atingido[playerid]);
        format(str,sizeof(str),"~r~~H~~H~%s ~w~-%.0f ~r~~h~~H~(%s) ~w~(%.0f)", PlayerName(issuerid), amount, WeaponNames[weaponid], floatround(totallife));
        TextDrawSetString(Atingido[playerid], str);
        TempoMostrarLife2[playerid] = SetTimerEx("HideTextoLife2", 3000, 0, "i", playerid);
        MostrandoVida2[playerid] = 1;

        KillTimer(TempoMostrarLife[issuerid]);
        TextDrawShowForPlayer(issuerid, Atingir[issuerid]);
        format(str,sizeof(str),"~g~~h~~h~%s ~w~-%.0f ~g~~h~~h~(%s) ~w~(%.0f)", PlayerName(playerid), amount, WeaponNames[weaponid], floatround(totallife));
        TextDrawSetString(Atingir[issuerid], str);
        TempoMostrarLife[issuerid] = SetTimerEx("HideTextoLife", 3000, 0, "i", issuerid);
        MostrandoVida[issuerid] = 1;
        PlayerPlaySound(issuerid , 17802, 0.0, 0.0, 0.0);
    }
    return 1;
}

forward HideTextoLife(playerid);
public HideTextoLife(playerid)
{
    if(MostrandoVida[playerid] == 1)
    {
        TextDrawHideForPlayer(playerid, Atingir[playerid]);
        MostrandoVida[playerid] = 0;
    }
    return 1;
}

forward HideTextoLife2(playerid);
public HideTextoLife2(playerid)
{
    if(MostrandoVida2[playerid] == 1)
    {
        TextDrawHideForPlayer(playerid, Atingido[playerid]);
        MostrandoVida2[playerid] = 0;
    }
    return 1;
}
Reply
#8

pawn Код:
#include <a_samp>

new WeaponNames[55][] =
{
        {"Punch"},{"Brass Knuckles"},{"Golf Club"},{"Nite Stick"},{"Knife"},{"Baseball Bat"},{"Shovel"},{"Pool Cue"},{"Katana"},{"Chainsaw"},{"Purple Dildo"},
        {"Smal White Vibrator"},{"Large White Vibrator"},{"Silver Vibrator"},{"Flowers"},{"Cane"},{"Grenade"},{"Tear Gas"},{"Molotov Cocktail"},
        {""},{""},{""}, // Empty spots for ID 19-20-21 (invalid weapon id's)
        {"Colt"},{"Silenced 9mm"},{"Deagle"},{"Shotgun"},{"Sawn-off"},{"Combat"},{"Micro SMG"},{"MP5"},{"AK-47"},{"M4"},{"Tec9"},
        {"Rifle"},{"Sniper"},{"Rocket"},{"HS Rocket"},{"Flamethrower"},{"Minigun"},{"Satchel Charge"},{"Detonator"},
        {"Spraycan"},{"Fire Extinguisher"},{"Camera"},{"Nightvision Goggles"},{"Thermal Goggles"},{"Parachute"}, {"Fake Pistol"},{""}, {"Vehicle"}, {"Helicopter Blades"},
        {"Explosion"}, {""}, {"Drowned"}, {"Collision"}
};


new Text:danos[MAX_PLAYERS];
new Text:danos2[MAX_PLAYERS];

new TempoMostrarLife[MAX_PLAYERS];
new MostrandoVida[MAX_PLAYERS];

new TempoMostrarLife2[MAX_PLAYERS];
new MostrandoVida2[MAX_PLAYERS];


stock PlayerName(playerid)
{
    new Name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
    return Name;
}

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" TEXTDRAW DAMAGE FEITO POR DOKyPWN");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerConnect(playerid)
{

for(new i; i < GetMaxPlayers(); i++)
{

danos[i] = TextDrawCreate(202.00000, 370.00000, " ");
TextDrawFont(danos[i], 1);
TextDrawColor(danos[i], 16727295);
TextDrawSetOutline(danos[i], 1);
TextDrawSetProportional(danos[i], 1);
TextDrawLetterSize(danos[i],  0.200000, 1.000000);
TextDrawAlignment(danos[i], 2 );
TextDrawSetShadow(danos[i], 0 );

danos2[i] = TextDrawCreate(440.00000, 370.00000, " ");
TextDrawFont(danos2[i], 1);
TextDrawColor(danos2[i], 0x00FFB0FF);
TextDrawSetOutline(danos2[i], 1);
TextDrawSetProportional(danos2[i], 1);
TextDrawLetterSize(danos2[i],  0.200000, 1.000000);
TextDrawAlignment(danos2[i], 2 );
TextDrawSetShadow(danos2[i], 0 );

}}

public OnPlayerDisconnect(playerid, reason)
{
  TextDrawDestroy(danos[playerid]);
  TextDrawDestroy(danos2[playerid]);

  return 1;
}


public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{

if (issuerid  != INVALID_PLAYER_ID)
{
            new str[1500];
            KillTimer(TempoMostrarLife2[playerid]);
            TextDrawShowForPlayer(playerid, danos2[playerid]);
            format(str,sizeof(str),"~r~~H~%s  ~w~-%.2f  ~r~~H~(%s) / ~w~(%.0f)", PlayerName(issuerid), amount, WeaponNames[weaponid]);
            TextDrawSetString(danos2[playerid], str);
            TempoMostrarLife2[playerid] = SetTimerEx("HideTextoLife2", 3000, 0, "i", playerid);
            MostrandoVida2[playerid] = 1;

            KillTimer(TempoMostrarLife[issuerid]);
            TextDrawShowForPlayer(issuerid, danos[issuerid]);
            format(str,sizeof(str),"~g~~h~~h~%s  ~w~-%.2f  ~g~~h~~h~(%s) / ~w~(%.0f)", PlayerName(playerid), amount, WeaponNames[weaponid]);
            TextDrawSetString(danos[issuerid], str);
            TempoMostrarLife[issuerid] = SetTimerEx("HideTextoLife", 3000, 0, "i", issuerid);
            MostrandoVida[issuerid] = 1;
            PlayerPlaySound(issuerid , 17802, 0.0, 0.0, 0.0);
}
return 1;
}

forward HideTextoLife(playerid);
public HideTextoLife(playerid)
{
    if(MostrandoVida[playerid] == 1)
    {
        TextDrawHideForPlayer(playerid, danos[playerid]);
        MostrandoVida[playerid] = 0;
    }
    return 1;
}


forward HideTextoLife2(playerid);
public HideTextoLife2(playerid)
{
    if(MostrandoVida2[playerid] == 1)
    {
        TextDrawHideForPlayer(playerid, danos2[playerid]);
        MostrandoVida2[playerid] = 0;
    }
    return 1;
}
}
[/QUOTE]
Reply
#9

PT: Nгo poste conteъdo portuguкs aqui. Essa й a board PT/BR: http://forum.sa-mp.com/forumdisplay.php?f=34
E recomendo que use [code][ /code] para postar seu cуdigo, ou pastebin se preferir.

ENG: Don't post portuguese content here. Here's the PT/BR board: http://forum.sa-mp.com/forumdisplay.php?f=34
And I recommend you to use [code][ /code] to post your code, or pastebin if you prefer.
Reply
#10

Now why would you need to use that string size(1500)? :\

Not bad.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)