SA-MP Forums Archive
Duda en este Codigo - 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: Duda en este Codigo (/showthread.php?tid=274868)



Duda en este Codigo - chucho - 07.08.2011

Se supone que este codigo hace que aparesca un texdraw depues desaparece y despues de x tiempo vuelve a aparecer pero otro texto en el texdraw pero resulta que cuando lo pongo nada mas aparece y depues desaparece y ya no vulve a salir
pawn Код:
#include <a_samp>

new Timer;
forward AutoAnuncios();
new Text:anuncios;
new TextAnuncios[][] =
{
    "Texto mas largo que puede entrar aqui1",
    "Texto mas largo que puede entrar aqui2",
    "Texto mas largo que puede entrar aqui3"
};
public OnPlayerConnect(playerid)
{
    TextDrawShowForPlayer(playerid, anuncios);
    return 1;
}
public OnGameModeInit()
{
    anuncios = TextDrawCreate(150.000000, 360.000000, " ");
    TextDrawAlignment(anuncios,0);
    TextDrawBackgroundColor(anuncios, 255);
    TextDrawFont(anuncios, 1);
    TextDrawLetterSize(anuncios, 0.500000, 4.300000);
    TextDrawColor(anuncios, 65535);
    TextDrawSetOutline(anuncios, 0);
    TextDrawSetProportional(anuncios, 1);
    SetTimer("AutoAnuncios",60000,1);

    Timer = SetTimer("ShowMessage",61000,1);
    return 1;
}
public OnFilterScriptExit()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
        TextDrawHideForPlayer(i, anuncios);
    TextDrawHideForAll(anuncios);
    TextDrawDestroy(anuncios);
    KillTimer(Timer);
    return 1;
}
public AutoAnuncios()
{
    TextDrawSetString(anuncios, TextAnuncios[random(sizeof(TextAnuncios))]);
    return 1;
}


forward ShowMessage( );
public ShowMessage( )
{
    TextDrawShowForAll(anuncios);

    SetTimer("HideMessage",30000,1);
}

forward HideMessage( );
public HideMessage( )
{
    TextDrawHideForAll(anuncios);

}



Respuesta: Duda en este Codigo - M1tux3r - 07.08.2011

Prueba asн:

Код:
#include <a_samp>

new Timer;
forward AutoAnuncios();
new Text:anuncios;
new TextAnuncios[][] =
{
    "Texto mas largo que puede entrar aqui1",
    "Texto mas largo que puede entrar aqui2",
    "Texto mas largo que puede entrar aqui3"
};
public OnPlayerConnect(playerid)
{
    TextDrawShowForPlayer(playerid, anuncios);
    return 1;
}
public OnGameModeInit()
{
    anuncios = TextDrawCreate(150.000000, 360.000000, " ");
    TextDrawAlignment(anuncios,0);
    TextDrawBackgroundColor(anuncios, 255);
    TextDrawFont(anuncios, 1);
    TextDrawLetterSize(anuncios, 0.500000, 4.300000);
    TextDrawColor(anuncios, 65535);
    TextDrawSetOutline(anuncios, 0);
    TextDrawSetProportional(anuncios, 1);
    Timer = SetTimer("AutoAnuncios", 60000, 1);
    return 1;
}
public OnGamemodeExit()
{
    for(new i = 0; i < MAX_PLAYERS; i++) { TextDrawHideForPlayer(i, anuncios); }
    TextDrawHideForAll(anuncios);
    TextDrawDestroy(anuncios);
    KillTimer(Timer);
    return 1;
}
public AutoAnuncios()
{
    TextDrawSetString(anuncios, TextAnuncios[random(sizeof(TextAnuncios))]);
    TextDrawShowForAll(anuncios);
    SetTimer("HideMessage", 30000, 0);
    return 1;
}


forward HideMessage( );
public HideMessage( )
{
    TextDrawHideForAll(anuncios);

}



Respuesta: Duda en este Codigo - chucho - 07.08.2011

me da este warning
pawn Код:
C:\Documents and Settings\\Escritorio\SERVIDOR\SERVIDOR\\Textos1.pwn(30) : warning 235: public function lacks forward declaration (symbol "OnGamemodeExit")
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPha
1 Warning.



Respuesta: Duda en este Codigo - M1tux3r - 07.08.2011

Cambia "OnGamemodeExit"
por: OnGameModeExit


Respuesta: Duda en este Codigo - TiNcH010 - 08.08.2011

O tal vez puede que sea por que la funcion del callback OnGameModeExit no la este usando y le da ese warning como que "esta de mas"


Respuesta: Duda en este Codigo - chucho - 08.08.2011

si ya se soluciono mi problema de hecho era que el callback esta una m en minisculas pero no lo note saludos!