їPorquй no funciona?
#1

Buenas, estube haciendo un sistema para que un textdraw sea como un gametextforplayer, que se muestre un determinado tiempo y luego se esconda. Pero el problema es que el textdraw no se esconde, queda allн. Les muestro como puse los timers y demбs definiciones:

PHP код:
stock GameTextDraw(playerid,string[],tiempo)
{
    if (!
GetPVarInt(playerid,"TextMsgMostrado"))
    {
        
TextDrawSetString(MsgText[playerid],string);
        
TextDrawShowForPlayer(playerid,MsgText[playerid]);
          
SetPVarInt(playerid,"TextMsgMostrado",1);
        
SetTimerEx("EsconderMsg",tiempo,0,"d",playerid);
    }
    return 
1;
}
stock EsconderText(playerid
{
    
TextDrawHideForPlayer(playerid,MsgText[playerid]);
    
SetPVarInt(playerid,"TextMsgMostrado",0);
    return 
1;

Modo de uso:

PHP код:
GameTextDraw(playerid"[] ЎNo puedes usar esto!"5000); 
їEs posible que sea eso del SetPVarInt? Uso y_ini.
Reply
#2

por ke los timers no responden con stock debes utilizar forward y public.

pawn Код:
stock GameTextDraw(playerid,string[],tiempo) {
    if (!GetPVarInt(playerid,"TextMsgMostrado")) {
        TextDrawShowForPlayer(playerid,MsgText[playerid]);
        TextDrawSetString(MsgText[playerid],string);      
        SetPVarInt(playerid,"TextMsgMostrado",true);
        SetTimerEx("EsconderMsg",tiempo,0,"d",playerid);
    }
    return true;
}

forward EsconderMsg(playerid);
public EsconderMsg(playerid)  {
    TextDrawHideForPlayer(playerid,MsgText[playerid]);
    SetPVarInt(playerid,"TextMsgMostrado",false);
    return true;
}
EDIT: y tienes otra cosa, si te fijas bien tienes el SetTimerEx con un nombre y el stock del SetTimerEx con otro .
Reply
#3

Muchas gracias, me sirviу.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)