[Ajuda] meio que [Pedido] mostrar vida
#9

Quote:
Originally Posted by [BOPE]Seu._.Madruga
Посмотреть сообщение
Pronto arrumei o cуdigo e jб arrumei outra parada.

Ajudei? +Rep

° Se for filterscript:
PHP код:
public OnFilterScriptInit()
{
    for(new 
0MAX_PLAYERSi++)
    {
        
MostrarVida[i] = TextDrawCreate(370.000000,396.000000," ");
        
TextDrawTextSize(MostrarVida[i],645.000000,1.000000);
        
TextDrawAlignment(MostrarVida[i],0);
        
TextDrawFont(MostrarVida[i],3);
        
TextDrawLetterSize(MostrarVida[i],0.490000,1.130000);
        
TextDrawColor(MostrarVida[i],0xffffffff);
        
TextDrawSetOutline(MostrarVida[i],1);
        
TextDrawSetProportional(MostrarVida[i],1);
        
TextDrawSetShadow(MostrarVida[i],1);
    }
    return 
1;

° Se for direto no Gamemode:
PHP код:
public OnGameModeInit()
{
    for(new 
0MAX_PLAYERSi++)
    {
        
MostrarVida[i] = TextDrawCreate(370.000000,396.000000," ");
        
TextDrawTextSize(MostrarVida[i],645.000000,1.000000);
        
TextDrawAlignment(MostrarVida[i],0);
        
TextDrawFont(MostrarVida[i],3);
        
TextDrawLetterSize(MostrarVida[i],0.490000,1.130000);
        
TextDrawColor(MostrarVida[i],0xffffffff);
        
TextDrawSetOutline(MostrarVida[i],1);
        
TextDrawSetProportional(MostrarVida[i],1);
        
TextDrawSetShadow(MostrarVida[i],1);
    }
    return 
1;

° Cуdigo completo:
PHP код:
//#define FILTERSCRIPT
#include <a_samp>
new TempoMostrarLife[MAX_PLAYERS];
new 
MostrandoVida[MAX_PLAYERS];
new 
Text:MostrarVida[MAX_PLAYERS];
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
    return 
1;
}
public 
OnFilterScriptExit()
{
    return 
1;
}
#else
main()
{
    print(
"\n----------------------------------");
    print(
" Blank Gamemode by your name here");
    print(
"----------------------------------\n");
}
#endif
public OnGameModeInit()
{
    for(new 
0MAX_PLAYERSi++)
    {
        
MostrarVida[i] = TextDrawCreate(370.000000,396.000000," ");
        
TextDrawTextSize(MostrarVida[i],645.000000,1.000000);
        
TextDrawAlignment(MostrarVida[i],0);
        
TextDrawFont(MostrarVida[i],3);
        
TextDrawLetterSize(MostrarVida[i],0.490000,1.130000);
        
TextDrawColor(MostrarVida[i],0xffffffff);
        
TextDrawSetOutline(MostrarVida[i],1);
        
TextDrawSetProportional(MostrarVida[i],1);
        
TextDrawSetShadow(MostrarVida[i],1);
    }
    return 
1;
}
public 
OnPlayerTakeDamage(playeridissueridFloat:amountweaponid)
{
    if(
IsPlayerConnected(playerid))
    {
        new 
str[256], aname[MAX_PLAYER_NAME];
        
PlayerPlaySound(playerid1095,  0.00.00.0);
        
PlayerPlaySound(issuerid6401,  0.00.00.0);
        
//===================[ playerid ]==================================
        
new Float:health;
        
GetPlayerHealth(playeridhealth);
        if(
issuerid == INVALID_PLAYER_ID)
        {
            
KillTimer(TempoMostrarLife[playerid]);
            
TextDrawShowForPlayer(playeridMostrarVida[playerid]);
            
format(str,sizeof(str),"~y~Vida:~r~  -%.1f"amount);
            
TextDrawSetString(MostrarVida[playerid], str);
            
TempoMostrarLife[playerid] = SetTimerEx("HideTextoLife"30000"i"playerid);
            
MostrandoVida[playerid] = 1;
        }
        else
        {
            
KillTimer(TempoMostrarLife[playerid]);
            
TextDrawShowForPlayer(playeridMostrarVida[playerid]);
            
GetPlayerName(issueridaname,sizeof(aname));
            
format(str,sizeof(str),"~y~%s ~n~~w~tirou:  ~r~-%.1f"anameamount);
            
TextDrawSetString(MostrarVida[playerid], str);
            
TempoMostrarLife[playerid] = SetTimerEx("HideTextoLife"30000"i"playerid);
            
MostrandoVida[playerid] = 1;
        }
        
//==================[ issuerid ] ======================================
        
KillTimer(TempoMostrarLife[issuerid]);
        
TextDrawShowForPlayer(issueridMostrarVida[issuerid]);
        
GetPlayerName(playeridaname,sizeof(aname));
        
format(str,sizeof(str),"~y~%s:~g~  -%.1f",anameamount);
        
TextDrawSetString(MostrarVida[issuerid], str);
        
TempoMostrarLife[issuerid] = SetTimerEx("HideTextoLife"30000"i"issuerid);
        
MostrandoVida[issuerid] = 1;
    }
    return 
true;
}
forward HideTextoLife(playerid);
public 
HideTextoLife(playerid)
{
    if(
MostrandoVida[playerid] == 1)
    {
        
TextDrawHideForPlayer(playeridMostrarVida[playerid]);
        
MostrandoVida[playerid] = 0;
    }
    return 
true;

Obrigado, Vlw REP+
Reply


Messages In This Thread
Close - by Slipk - 02.11.2014, 11:37
Re: meio que [Pedido] mostrar vida - by ipsLuan - 02.11.2014, 11:43
Re: meio que [Pedido] mostrar vida - by Slipk - 02.11.2014, 11:55
Re: meio que [Pedido] mostrar vida - by Slipk - 02.11.2014, 11:57
Re: meio que [Pedido] mostrar vida - by ipsLuan - 02.11.2014, 12:06
Re: meio que [Pedido] mostrar vida - by Slipk - 02.11.2014, 12:09
Re: meio que [Pedido] mostrar vida - by [BOPE]Seu._.Madruga - 02.11.2014, 12:42
Re: meio que [Pedido] mostrar vida - by PT - 02.11.2014, 13:03
Re: meio que [Pedido] mostrar vida - by Slipk - 02.11.2014, 14:09
Re: meio que [Pedido] mostrar vida - by Slipk - 02.11.2014, 14:11

Forum Jump:


Users browsing this thread: 3 Guest(s)