SA-MP Forums Archive
Textdraw - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: Textdraw (/showthread.php?tid=546298)



Textdraw - Metzone - 14.11.2014

Buenas, tengo un problema con un textdraw, bueno cada vez que golpeo a alguien, me sale un textdraw en la pantalla, que al pasar 60 segundos, se borra, abajo estб todo el sistema, y bueno, el problema es que cada vez que golpeo, hace un tiempo aleatorio menor a 10 segundos, por ejemplo, golpeo, y en 3 segundos se quita el textdraw, y es como si hubiera pasado 60 segundos, ya que puedo hacer cosas que no deberia de poder hasta pasar los 60 segundos.




pawn Код:
new Timer_Golpeado[MAX_PLAYERS];
new Text:TextdrawGolpeado;


TextdrawGolpeado= TextDrawCreate(70.000000, 217.000000, "-");
TextDrawBackgroundColor(TextdrawGolpeado, 120);
TextDrawFont(TextdrawGolpeado, 3);
TextDrawLetterSize(TextdrawGolpeado, 2.429999, 16.100000);
TextDrawColor(TextdrawGolpeado, -16776961);
TextDrawSetOutline(TextdrawGolpeado, 1);
TextDrawSetProportional(TextdrawGolpeado, 0);
TextDrawSetSelectable(TextdrawGolpeado, 0);




public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
TextDrawShowForPlayer(playerid, TextdrawCombate);
Info[playerid][pCombate] = 1;
Timer_Golpeado[playerid] = SetTimerEx("Golpeado", 60000, true, "i", playerid);
return 1;
}

forward Golpeado(playerid);
public Golpeado(playerid)
{
TextDrawHideForPlayer(playerid, TextdrawGolpeado);
KillTimer(Timer_Golpeado[playerid]);
return 1;
}



Respuesta: Textdraw - jotajeda - 14.11.2014

Arrancas el timer Timer_Parpadeo y luego matas el Timer_Golpeado, ї Y cuando matas al Timer_Parpadeo?


Respuesta: Textdraw - Juand - 14.11.2014

Quote:
Originally Posted by jotajeda
Посмотреть сообщение
Arrancas el timer Timer_Parpadeo y luego matas el Timer_Golpeado, ї Y cuando matas al Timer_Parpadeo?
OFF: eh una pregunta: que obsesiуn tienes con el vнdeo de ayer culie versiуn samp? D: hasta en tu firma esta que enfermo estas loco D: sali un poco a tomar aire jajaja D:
PS: no te creas mucho usando traductor de binarios ^^

ON: por que no mejor haces una variable para detectar si esta golpeando o no? a si si golpea 1 vez no se repite el timer 2 veces (2 veces golpeaste 2 veces se ejecuta, es un ejemplo), entonces haz que si golpeas 1 vez comienze el timer y has una restricciуn de que si ya has golpeado 1 o mas veces no se ejecute el timer es todo (o bien puedes matarlo y crearlo)...


Respuesta: Textdraw - jotajeda - 14.11.2014

Quote:
Originally Posted by Juand
Посмотреть сообщение
OFF: eh una pregunta: que obsesiуn tienes con el vнdeo de ayer culie versiуn samp? D: hasta en tu firma esta que enfermo estas loco D: sali un poco a tomar aire jajaja D:
PS: no te creas mucho usando traductor de binarios ^^

ON: por que no mejor haces una variable para detectar si esta golpeando o no? a si si golpea 1 vez no se repite el timer 2 veces (2 veces golpeaste 2 veces se ejecuta, es un ejemplo), entonces haz que si golpeas 1 vez comienze el timer y has una restricciуn de que si ya has golpeado 1 o mas veces no se ejecute el timer es todo (o bien puedes matarlo y crearlo)...
Solo es para ver a los gilipollas que pierden su tiempo usando el traductor de binarios.


Re: Textdraw - Metzone - 14.11.2014

Lol lo de parpadeo no se de donde slaio, esta corregido, pero me sige sacando el texdraw a los 3,4, 7 segundos...


Respuesta: Textdraw - jotajeda - 14.11.2014

Usa solamente SetTimerEx("Golpeado", 60000, false, "i", playerid);


Respuesta: Textdraw - OTACON - 14.11.2014

pawn Код:
new Timer_Golpeado[MAX_PLAYERS];
new Text:TextdrawGolpeado;

TextdrawGolpeado= TextDrawCreate(70.000000, 217.000000, "-");
TextDrawBackgroundColor(TextdrawGolpeado, 120);
TextDrawFont(TextdrawGolpeado, 3);
TextDrawLetterSize(TextdrawGolpeado, 2.429999, 16.100000);
TextDrawColor(TextdrawGolpeado, -16776961);
TextDrawSetOutline(TextdrawGolpeado, 1);
TextDrawSetProportional(TextdrawGolpeado, 0);
TextDrawSetSelectable(TextdrawGolpeado, 0);

public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid){
    if(playerid != INVALID_PLAYER_ID){
        TextDrawHideForPlayer(playerid, TextdrawGolpeado);
        Info[playerid][pCombate] = 1;
        KillTimer(Timer_Golpeado[playerid]);
        Timer_Golpeado[playerid] = SetTimerEx("Golpeado", 60*1000, true, "i", playerid);
        TextDrawShowForPlayer(playerid, TextdrawCombate);
    }
    return true;
}

forward Golpeado(playerid); public Golpeado(playerid){
    TextDrawHideForPlayer(playerid, TextdrawGolpeado);
    KillTimer(Timer_Golpeado[playerid]);
    Info[playerid][pCombate] = 0;
    return true;
}