Setting a timer for something - How can I do it?
#1

Hello,

I want to set a timer for a Textdraw to be removed.

For examlpe to set a timer that removed a Textdraw every 30 seconds.

TextDrawHideForAll(Textdraw7); <---- That's the removal line, I want to set it in a timer so a timer removes Textdraw 7 every 30 seconds.

Thanks in advance .
Reply
#2

Make a callback, and a timer of 30,000 ms which will call the callback you made!
Reply
#3

Can you do it for me or show me an examlpe? I don't know how to use Timers .
Reply
#4

Code:
forward Hidetextdraw();

public OnGameModeInt()
{
     SetTimer("Hidetextdraw", 30000, 0);
     return 1;
}

public Hidetextdraw()
{
     TextDrawHideForAll(Textdraw7);
}
done
Reply
#5

You are going to have to make two publics and two timers, because you are going to have to make it show up again which you can do this by...

pawn Code:
forward HideTextdraw() //these forward the later used custom callbacks
forward ShowTextdraw() // ^^

public OnGameModeInit() //ongamemodeinit callback
{
SetTimer("HideTextdraw", 7000, false); //false, it won't keep repeating
return 1;
}

public HideTextdraw()
{
HideTextDrawForAll(Textdraw7); //hide the textdraw
SetTimer("ShowTextdraw", 250, false); //setting a timer, false... won't repeat
return 1;
}
public ShowTextDraw()
{
TextDrawShowForPlayer); //shows the textdraw
SetTimer("HideTextDraw", 7000, false); and sets the timer for it to hide, then it will reset the timer.
return 1;
}
That should do it
Reply
#6

Why nobody understand how to use tabs.
pawn Code:
public OnGameModeInit() //ongamemodeinit callback
{
    SetTimer("HideTextdraw", 7000, false); //false, it won't keep repeating
    return 1;
}

forward HideTextdraw()
public HideTextdraw()
{
    HideTextDrawForAll(Textdraw7); //hide the textdraw
    SetTimer("ShowTextdraw", 250, false); //setting a timer, false... won't repeat
    return 1;
}

forward ShowTextdraw()
public ShowTextDraw()
{
    TextDrawShowForPlayer); //shows the textdraw
    SetTimer("HideTextDraw", 7000, false); and sets the timer for it to hide, then it will reset the timer.
    return 1;
}
Reply
#7

I do kingunit.. just wen i press tab it does weird stuff, and wasn't going to open a new pwn just for this, and why just copy my code, i'm sure he knows how to indent hhis code.
Reply
#8

Quote:
Originally Posted by BigAl
View Post
I do kingunit.. just wen i press tab it does weird stuff, and wasn't going to open a new pwn just for this, and why just copy my code, i'm sure he knows how to indent hhis code.
I've used your code to fix the tabs. Sure in your browser you cannot use TAB, in your browser TAB is going to another link or button.
Reply
#9

Yes, so don't make akustions (however you spell it) that I can't use tabs because I can use them fine. You could have just put here is the code indented... and then put the code I made...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)