Player textdraw with timer
#1

Hello again, ehm please don't kill me because I have asked a few questions lately.

I'm having some trouble with my textdraw which is supposed to show up if someone writes an invalid command for instance, then dissapear after like 5 seconds. I tried to do that, and the textdraw shows up but it never appears.

I also have some general questions regarding textdraws. Do I always need to place textdraws OnPlayerConnect? Meaning I can't have them in an include and store them somewhere else, becasue you know textdraws takes up so much space so I'd like to hide all my textdraws a little. Could of course make an include for OnPlayerConnect or whatever, but don't really know how that works out. My current code:

To make it easier to read through I uploaded it to pastebin:
http://pastebin.com/dszZKum5

It is probably shit, therefore I need suggestions how to improve and make it work.
Reply
#2

Put a few prints and see if the functions are executed.
You could put your Textdraw Code in a stock/function which is located in an include, then include the Include into your main script and put into On playeR connect just one single line of code to load the stock/function.
Reply
#3

It never appears because you aren't showing it to the player in the first place. Or are you deliberately not putting code in the pastebin? I'm thinking OnPlayerCommandPerformed being a key function in this.
Reply
#4

Move the timer to the function, don't put it in OnPlayerConnect.

Kill the timer when the function is used again.

Player TextDraws go in OnPlayerConnect. Global TDs go in OnGameModeInIt.
Reply
#5

It does appear, the problem is that it doesn't dissapear Andy.
"It never appears because you aren't showing it to the player in the first place". I'm?
@Sick will try.

Confused.
Reply
#6

Quote:
Originally Posted by TheBigFive
Посмотреть сообщение
I tried to do that, and the textdraw shows up but it never appears.
Quote:
Originally Posted by TheBigFive
Посмотреть сообщение
It does appear, the problem is that it doesn't dissapear Andy.
"It never appears because you aren't showing it to the player in the first place". I'm?
I skimmed over the text and saw "it never appears" and not "The textdraw shows up" (see your quote). Sorry.
The timer after creating the textdraw is pretty useless since you're not showing the textdraw at that point. Instead, put the timer in your ServerMSG function as SickAttack said.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)