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

@Close
Reply
#2

Vocк colocou [i] sem o loop.

pawn Код:
public OnGameModeInit()
{
    for(new i = 0; i < MAX_PLAYERS; i++) {
        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;
}
Reply
#3

nuss nem vi vlw vo tentar aqui
Reply
#4

afs ...
sу resolveu 1, ta tenso esse code meu ...
Quote:

C:\Users\testes\Desktop\asjkdasjkdffssfakfjas.pwn( 24) : error 017: undefined symbol "MostrarVida"
C:\Users\testes\Desktop\asjkdasjkdffssfakfjas.pwn( 24) : warning 215: expression has no effect
C:\Users\testes\Desktop\asjkdasjkdffssfakfjas.pwn( 24) : error 001: expected token: ";", but found "]"
C:\Users\testes\Desktop\asjkdasjkdffssfakfjas.pwn( 24) : error 029: invalid expression, assumed zero
C:\Users\testes\Desktop\asjkdasjkdffssfakfjas.pwn( 24) : fatal error 107: too many error messages on one line
Reply
#5

Poste o FilterScript todo... ¬¬'
Reply
#6

ta completa kkk so ta faltando #include < a_samp >
kkk ....
Reply
#7

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;

Quote:

Compilando Sem tнtulo 1.pwn...
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

Sem tнtulo 1.pwn compilado com sucesso

Reply
#8

Essa logica esta errada nesses casos deve ser utilizado Player Textdraw, para isso й que elas foram feitas.
Reply
#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
#10

Quote:
Originally Posted by PT
Посмотреть сообщение
Essa logica esta errada nesses casos deve ser utilizado Player Textdraw, para isso й que elas foram feitas.
vlw por enformar prуxima vez nгo a verб esse erro meu, Obrigado
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)