[Ajuda]Ajuda no relogio com TextDrawn
#1

Bem eu to com um probleminha aqui no meu GM que nгo sу no relуgio mas senpre q tento colocar uma text drawn da erro

Erros:

Код:
C:\Users\Seven\Documents\GTA San Andreas User Files\Pawno 0.3e server\gamemodes\MDM.pwn(38) : error 017: undefined symbol "Textdraw0"
C:\Users\Seven\Documents\GTA San Andreas User Files\Pawno 0.3e server\gamemodes\MDM.pwn(39) : error 017: undefined symbol "Textdraw0"
C:\Users\Seven\Documents\GTA San Andreas User Files\Pawno 0.3e server\gamemodes\MDM.pwn(40) : error 017: undefined symbol "Textdraw0"
C:\Users\Seven\Documents\GTA San Andreas User Files\Pawno 0.3e server\gamemodes\MDM.pwn(41) : error 017: undefined symbol "Textdraw0"
C:\Users\Seven\Documents\GTA San Andreas User Files\Pawno 0.3e server\gamemodes\MDM.pwn(42) : error 017: undefined symbol "Textdraw0"
C:\Users\Seven\Documents\GTA San Andreas User Files\Pawno 0.3e server\gamemodes\MDM.pwn(43) : error 017: undefined symbol "Textdraw0"
C:\Users\Seven\Documents\GTA San Andreas User Files\Pawno 0.3e server\gamemodes\MDM.pwn(44) : error 017: undefined symbol "Textdraw0"
C:\Users\Seven\Documents\GTA San Andreas User Files\Pawno 0.3e server\gamemodes\MDM.pwn(45) : error 017: undefined symbol "Textdraw0"
C:\Users\Seven\Documents\GTA San Andreas User Files\Pawno 0.3e server\gamemodes\MDM.pwn(47) : error 017: undefined symbol "Textdraw1"
C:\Users\Seven\Documents\GTA San Andreas User Files\Pawno 0.3e server\gamemodes\MDM.pwn(48) : error 017: undefined symbol "Textdraw1"
C:\Users\Seven\Documents\GTA San Andreas User Files\Pawno 0.3e server\gamemodes\MDM.pwn(49) : error 017: undefined symbol "Textdraw1"
C:\Users\Seven\Documents\GTA San Andreas User Files\Pawno 0.3e server\gamemodes\MDM.pwn(50) : error 017: undefined symbol "Textdraw1"
C:\Users\Seven\Documents\GTA San Andreas User Files\Pawno 0.3e server\gamemodes\MDM.pwn(51) : error 017: undefined symbol "Textdraw1"
C:\Users\Seven\Documents\GTA San Andreas User Files\Pawno 0.3e server\gamemodes\MDM.pwn(52) : error 017: undefined symbol "Textdraw1"
C:\Users\Seven\Documents\GTA San Andreas User Files\Pawno 0.3e server\gamemodes\MDM.pwn(53) : error 017: undefined symbol "Textdraw1"
C:\Users\Seven\Documents\GTA San Andreas User Files\Pawno 0.3e server\gamemodes\MDM.pwn(54) : error 017: undefined symbol "Textdraw1"
C:\Users\Seven\Documents\GTA San Andreas User Files\Pawno 0.3e server\gamemodes\MDM.pwn(91) : error 017: undefined symbol "Textdraw0"
C:\Users\Seven\Documents\GTA San Andreas User Files\Pawno 0.3e server\gamemodes\MDM.pwn(92) : error 017: undefined symbol "Textdraw1"
C:\Users\Seven\Documents\GTA San Andreas User Files\Pawno 0.3e server\gamemodes\MDM.pwn(389) : warning 235: public function lacks forward declaration (symbol "hora")
C:\Users\Seven\Documents\GTA San Andreas User Files\Pawno 0.3e server\gamemodes\MDM.pwn(400) : warning 217: loose indentation
C:\Users\Seven\Documents\GTA San Andreas User Files\Pawno 0.3e server\gamemodes\MDM.pwn(417) : warning 217: loose indentation
C:\Users\Seven\Documents\GTA San Andreas User Files\Pawno 0.3e server\gamemodes\MDM.pwn(417) : error 017: undefined symbol "Textdraw0"
C:\Users\Seven\Documents\GTA San Andreas User Files\Pawno 0.3e server\gamemodes\MDM.pwn(419) : warning 217: loose indentation
C:\Users\Seven\Documents\GTA San Andreas User Files\Pawno 0.3e server\gamemodes\MDM.pwn(419) : error 017: undefined symbol "Textdraw1"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


20 Errors.
New da Text Drawn(relуgio) + a forward:

Код:
new Text:Textdraw0;
new Text:Textdraw1;
forward hora(playerid);
Parte da TextDrawn + o SetTimer (OnGameModeInit):

Код:
    SetTimer("hora",1000,1);
    Textdraw0 = TextDrawCreate(491.000000, 129.000000, "00:00:00");
    TextDrawBackgroundColor(Textdraw0, 255);
    TextDrawFont(Textdraw0, 1);
    TextDrawLetterSize(Textdraw0, 0.500000, 1.000000);
    TextDrawColor(Textdraw0, -1);
    TextDrawSetOutline(Textdraw0, 0);
    TextDrawSetProportional(Textdraw0, 1);
    TextDrawSetShadow(Textdraw0, 1);

    Textdraw1 = TextDrawCreate(489.000000, 115.000000, "00/00/00");
    TextDrawBackgroundColor(Textdraw1, 255);
    TextDrawFont(Textdraw1, 1);
    TextDrawLetterSize(Textdraw1, 0.500000, 1.000000);
    TextDrawColor(Textdraw1, -1);
    TextDrawSetOutline(Textdraw1, 0);
    TextDrawSetProportional(Textdraw1, 1);
    TextDrawSetShadow(Textdraw1, 1);
Parte do OnPlayerConnect:
Код:
    TextDrawShowForPlayer(playerid, Textdraw0);//nome da draw no caso a que definimos la emcima
    TextDrawShowForPlayer(playerid, Textdraw1);
Parte para o Relogio funcionar(forward hora q ta la em cima^^):

Код:
public hora(playerid)
{
     new str[128],//criamos a primeira string
          str2[128],//criamos a segunda string
               year, //criamos a variavel Ano
                    month,//criamos a Varivel mes
                        day,//criamos a Variavel dia
                            hour,//criamos  a Variavel hora
                               minute,//criamos a Variavel minutos
                                   second;//criamos a variavel segundos

    getdate(year, month, day);//getamos a data em ANO:MES:DIA
    gettime(hour,minute,second);//getamos o tempo em HORAS:MINUTOS:SEGUNDOS
    new mes[12];//definimos uma Array para armarzenar os meses

    if(month == 1) { mes = "1"; }//criamos a primeira IF do mes 1 Voce poderia EX:colocar janeiro no lugar de '1'
    else if(month == 2) {mes = "2";}//getamos o mes 2
    else if(month == 3) {mes = "3";}//getamos o mes 3
    else if(month == 4) {mes = "4";}// Assim em diante lembrando, voce podera colocar o mes em nome! Nao em numeros ai fica a criterio!
    else if(month == 5) {mes = "5";}
    else if(month == 6) {mes = "6";}
    else if(month == 7) {mes = "7";}
    else if(month == 8) {mes = "8";}
    else if(month == 9) {mes = "9";}
    else if(month == 10) {mes = "10";}
    else if(month == 11) {mes = "11";}
    else if(month == 12) {mes= "12";}
    format(str, sizeof(str), "%d/%s/%d", day, mes,year);//criamos o formato da string sempre usando o '%d' no caso'DIA/MES/ANO' por isso %d/%d/%d
        TextDrawSetString(Text:Textdraw0, str);//aki a Draw para definir a string,Text:Textdraw0 e o nome da draw la no inicio, a 'str' e a que colocamos no inicio
        format(str2, sizeof(str2), "%d:%d:%d", hour, minute, second);//aqui usaremos a str2 usamos '%d:%d:%d' de Horas:minutos:segundos
    TextDrawSetString(Text:Textdraw1, str2);//se seu GM usa outra Draw no lugar da Text:Textdraw1 mude
}
^

Eu peguei esses codigos de um tuto mas й q nao da de faser nemhuma TextDrawn.

Por favor me ajudem quem ajudar, ja agradeзo des de ja.
Reply
#2

Vocк colocou as variбveis TextDraw0 e TextDraw1 como globais?
Reply
#3

Dei uma olhada nesses troзo de variavel, ela ta como global sim
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)