[FilterScript] DAMAGE TEXTDRAW
#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


Messages In This Thread
DAMAGE TEXTDRAW - by DokyPWN - 04.11.2014, 05:59
Re: DAMAGE TEXTDRAW - by M0HAMMAD - 04.11.2014, 07:55
Re: DAMAGE TEXTDRAW - by HeLiOn_PrImE - 04.11.2014, 08:55
Re: DAMAGE TEXTDRAW - by Toxik - 04.11.2014, 10:37
Re: DAMAGE TEXTDRAW - by Alex Magaсa - 04.11.2014, 10:45
Re: DAMAGE TEXTDRAW - by JasperM - 04.11.2014, 10:48
Re: DAMAGE TEXTDRAW - by DyduShxD - 13.11.2014, 06:06
Re: DAMAGE TEXTDRAW - by DokyPWN - 13.11.2014, 16:26
Re: DAMAGE TEXTDRAW - by PaulMcCartney - 13.11.2014, 16:34
Re: DAMAGE TEXTDRAW - by Kyance - 13.11.2014, 19:14

Forum Jump:


Users browsing this thread: 1 Guest(s)