їPorquй no funciona? - 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: їPorquй no funciona? (
/showthread.php?tid=424767)
їPorquй no funciona? -
jwalker - 23.03.2013
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.
Respuesta: їPorquй no funciona? -
OTACON - 23.03.2013
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 .
Respuesta: їPorquй no funciona? -
jwalker - 23.03.2013
Muchas gracias, me sirviу.