Textdraw problem [Small problem] [+rep]
#1

Well I am trying to make draws to all players time how long you are running your server...
So if server is running 5 hours it should say so.

Errors:
PHP код:
 error 017undefined symbol "text1" 
I tried doing new
PHP код:
Texttext1
But still it was saying sort of "Never used"...

Here's the code:

PHP код:
new gSeconds 0
new 
TextgText// global "Text"
forward TimeServerRunning(); 
PHP код:
SetTimer("TimeServerRunning"1000true); 
PHP код:
public TimeServerRunning() {
    new 
string[16];
    
TextDrawDestroy(gText);
    
gSeconds++;
    
format(stringsizeof string"%s"TimeConvert(gSeconds));
    
text1 TextDrawCreate(10.0100.0string);
    
TextDrawUseBox(gTexttrue);
    
TextDrawTextSize(gText50.020.0);
    
TextDrawShowForAll(gText);

PHP код:
TimeConvert(time) {
    new 
minutes;
    new 
seconds;
    new 
string[256];
    if(
time 59){
        
minutes floatround(time/60);
        
seconds floatround(time minutes*60);
        if(
seconds>9)format(string,sizeof(string),"%d:%d",minutes,seconds);
        else 
format(string,sizeof(string),"%d:0%d",minutes,seconds);
    }
    else{
        
seconds floatround(time);
        if(
seconds>9)format(string,sizeof(string),"0:%d",seconds);
        else 
format(string,sizeof(string),"0:0%d",seconds);
    }
    return 
string;

Reply
#2

Have you got
"new Text: text1;" at the very top of your script ?
Reply
#3

Well no, since it's giving me
Quote:

warning 204: symbol is assigned a value that is never used: "text1"

Reply
#4

pawn Код:
text1 = TextDrawCreate(10.0, 100.0, string);
This should be

pawn Код:
gText = TextDrawCreate(10.0, 100.0, string);
This also why run it EVERY second thats going to cause lag...
Reply
#5

Doesnt work in game. Compiled it normally.
Reply
#6

Well after playing some time, around 10-20 minutes, it said 0:03 .... It's chaning REALLY slowly
Reply
#7

help?
Reply
#8

Can you show me the line of this error:
Код:
 error 017: undefined symbol "text1"
Reply
#9

I dont have the error anymore. I have only the problem of the timer... It's so slow...
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)