[Ajuda] TextDraw nгo carrega.
#1

Baixei um filterscript de textdraw, coloquei em meu server.cfg mas mesmo assim nгo consigo ver a mensagem na tela.


pawn Код:
#include <a_samp>
#pragma tabsize 0

new Text:Textdraw0;
new Text:Textdraw1;
new Text:Textdraw2;
new Text:Textdraw3;
new Text:txtTimeDisp;
new hour, minute;
new horadkn[32];
forward UpdateTime();
//--------------------------------------------------
public UpdateTime()
{
gettime(hour, minute);
format(horadkn,32,"%02d:%02d",hour,minute);
TextDrawSetString(txtTimeDisp,horadkn);

    SetWorldTime(hour);

    new x=0;
    while(x!=MAX_PLAYERS) {
        if(IsPlayerConnected(x) && GetPlayerState(x) != PLAYER_STATE_NONE) {
            SetPlayerTime(x,hour,minute);
         }
         x++;
    }
}

//--------------------------------------------------
public OnFilterScriptInit()
{
   

    Textdraw0 = TextDrawCreate(541.000000, 405.000000, "Lunaticos");
    TextDrawBackgroundColor(Textdraw0, 0xF6AD00AA);
    TextDrawFont(Textdraw0, 1);
    TextDrawLetterSize(Textdraw0, 0.559998, 2.599998);
    TextDrawColor(Textdraw0, 0xF6AD00AA);
    TextDrawSetOutline(Textdraw0, 1);
    TextDrawSetProportional(Textdraw0, 1);

    Textdraw1 = TextDrawCreate(584.000000, 408.000000, "Brasil");
    TextDrawBackgroundColor(Textdraw1, 0xFFFF00AA);
    TextDrawFont(Textdraw1, 1);
    TextDrawLetterSize(Textdraw1, 0.509998, 2.299998);
    TextDrawColor(Textdraw1, 0xFFFF00AA);
    TextDrawSetOutline(Textdraw1, 1);
    TextDrawSetProportional(Textdraw1, 1);

    Textdraw2 = TextDrawCreate(518.000000, 425.000000, "");
    TextDrawBackgroundColor(Textdraw2, 255);
    TextDrawFont(Textdraw2, 1);
    TextDrawLetterSize(Textdraw2, 0.209999, 1.100000);
    TextDrawColor(Textdraw2, -1);
    TextDrawSetOutline(Textdraw2, 1);
    TextDrawSetProportional(Textdraw2, 1);


   
    txtTimeDisp = TextDrawCreate(558.000000, 436.000000,"00:00");
    TextDrawBackgroundColor(txtTimeDisp, 255);
    TextDrawFont(txtTimeDisp, 1);
    TextDrawLetterSize(txtTimeDisp, 0.209999, 1.000000);
    TextDrawColor(txtTimeDisp, -1);
    TextDrawSetOutline(txtTimeDisp, 0);
    TextDrawSetProportional(txtTimeDisp, 1);
    TextDrawSetShadow(txtTimeDisp, 1);

    UpdateTime();
    SetTimer("UpdateTime",1000 * 60,1);

    for(new i; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerConnected(i))
        {
            TextDrawShowForPlayer(i, Textdraw0);
            TextDrawShowForPlayer(i, Textdraw1);
            TextDrawShowForPlayer(i, Textdraw2);
            TextDrawShowForPlayer(i, Textdraw3);
        }
    }
    return 1;
}
//--------------------------------------------------

public OnPlayerDeath(playerid, killerid, reason)
{
    TextDrawHideForPlayer(playerid,txtTimeDisp);
    return 1;
}

//--------------------------------------------------
//--------------------------------------------------

public OnPlayerSpawn(playerid)
{
    TextDrawShowForPlayer(playerid,txtTimeDisp);

    gettime(hour, minute);
    SetPlayerTime(playerid,hour,minute);

    return 1;
}

//--------------------------------------------------
public OnFilterScriptExit()
{
    TextDrawHideForAll(Textdraw0);
    TextDrawDestroy(Textdraw0);
    TextDrawHideForAll(Textdraw1);
    TextDrawDestroy(Textdraw1);
    TextDrawHideForAll(Textdraw2);
    TextDrawDestroy(Textdraw2);
    TextDrawHideForAll(Textdraw3);
    TextDrawDestroy(Textdraw3);
    return 1;
}

public OnPlayerConnect(playerid)
{
    gettime(hour, minute);
    SetPlayerTime(playerid,hour,minute);
    TextDrawShowForPlayer(playerid, Textdraw0);
    TextDrawShowForPlayer(playerid, Textdraw1);
    TextDrawShowForPlayer(playerid, Textdraw2);
    TextDrawShowForPlayer(playerid, Textdraw3);
    return 1;
}
Sou meio leigo em pawno, o q tem de errado no script?
Reply
#2

tira o
pawn Код:
for(new i; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerConnected(i))
        {
            TextDrawShowForPlayer(i, Textdraw0);
            TextDrawShowForPlayer(i, Textdraw1);
            TextDrawShowForPlayer(i, Textdraw2);
            TextDrawShowForPlayer(i, Textdraw3);
        }
    }
e coloca
pawn Код:
TextDrawShowForPlayer(playerid, Textdraw0);
    TextDrawShowForPlayer(playerid, Textdraw1);
    TextDrawShowForPlayer(playerid, Textdraw2);
    TextDrawShowForPlayer(playerid, Textdraw3);
no OnPlayerSpawn
Reply
#3

Agora sim deu, vlw pela ajuda.
abraзo!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)