[Pedido] Alguйm Arruma Isso aqui !
#1

pawn Код:
#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;
}




isso era para mostrar, um textDraw em cima da cabeзa do player, para quando ele fosse atingido, aparecesse i dano,
mais a textdraw ta aparecendo em baixo, perto do Radar.

alguem arruma para mim isso ?
Reply
#2

Sгo as coordenadas, mas acho que nгo tem como por textdraw no player, a nгo ser que vocк faзa algo com Text3D.
Reply
#3

/\ n sei fazer isso :\
Reply
#4

Pra que ficar criando tуpicos ?
pawn Код:
new Text3D:Sangue[MAX_PLAYERS];

public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
    if(damagedid != INVALID_PLAYER_ID)
    {
        new String[40];
        format(String, sizeof(String), "%.0f", amount);
        Sangue[damagedid] = Create3DTextLabel(String, -1, 30.0, 40.0, 50.0, 40.0, 0, 0);
        Attach3DTextLabelToPlayer(Sangue[damagedid], damagedid, 0.0, 0.0, 0.7);
        SetTimerEx("Retirar3D", 2000, false, "d", damagedid);
    }
    return 1;
}
//------------------------------------------------------------------------------
forward Retirar3D(playerid);
public Retirar3D(playerid)
{
     Delete3DTextLabel(Sangue[playerid]);
     return 1;
}
Reply
#5

pra aparecer encima do player tem que usar isso
https://sampwiki.blast.hk/wiki/Attach3DTextLabelToPlayer
Reply
#6

CreatePlayer3DTextLabel


Ou entгo faz com GameText, acho que fica mais legal

pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid) {

    static string[32];
   
    format(string, sizeof(string), "{32CD32}-{FF0000}%.0f", amount);
    GameTextForPlayer(playerid, string, 3000, 4);
   
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)