Personal Textdraws?
#1

I want to create personal textdraw for format it.. for example "Welcome Name" if i use the same txtdraw if somebody enter at the same timee would change the string and bug it!.. but i need to create something like new Text:welcome[MAX_PLAYERS] but i dont know :/
Reply
#2

Yup, this will work.

Under OnPlayerConnect: welcome[playerid]=TextDrawCreate....
and under OnPlayerDisconnect: TextDrawDestroy(welcome[playerid]);
Reply
#3

Quote:
Originally Posted by Jeffry
Посмотреть сообщение
Yup, this will work.

Under OnPlayerConnect: welcome[playerid]=TextDrawCreate....
and under OnPlayerDisconnect: TextDrawDestroy(welcome[playerid]);
Thxx i do that i want it appears on player spawn but that dont work here is my code friend.. i have format for it but i remove for test but dont appear textdraw ):

Код:
forward TextBienvenido(playerid);
forward TerminarBienvenida(playerid);

new Text:bienvenido[MAX_PLAYERS]; //----> Variable TextDraw Bienvenida

public OnPlayerConnect(playerid)
{
    TextBienvenido(playerid);
}

public OnPlayerSpawn(playerid)
{
    TextDrawShowForPlayer(playerid, bienvenido[playerid]);
    SetTimerEx("TerminarBienvenida", 4000, 0, "i", playerid);
}

public TextBienvenido(playerid)
{
    bienvenido[playerid] = TextDrawCreate(8.000000, 420.000000, "Bienvenido");
	TextDrawBackgroundColor(bienvenido[playerid], 255);
	TextDrawFont(bienvenido[playerid], 0);
	TextDrawLetterSize(bienvenido[playerid], 0.689999, 2.499999);
	TextDrawColor(bienvenido[playerid], -1);
	TextDrawSetOutline(bienvenido[playerid], 0);
	TextDrawSetProportional(bienvenido[playerid], 1);
	TextDrawSetShadow(bienvenido[playerid], 1);
}

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

public TerminarBienvenida(playerid)
{
    TextDrawHideForPlayer(playerid, bienvenido[playerid]);
}

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

public OnPlayerDisconnect(playerid, reason)
{
	TextDrawHideForAll(bienvenido[playerid]);
	TextDrawDestroy(bienvenido[playerid]);
	return 1;
}
the textdraw dont appear :S
Reply
#4

Try:

pawn Код:
public TextBienvenido(playerid)
{
    bienvenido[playerid] = TextDrawCreate(10, 175.0, "Bienvenido");
    TextDrawTextSize(bienvenido[playerid],150.000000,120.000000);
    TextDrawAlignment(bienvenido[playerid],0);
    TextDrawFont(bienvenido[playerid],1);
    TextDrawLetterSize(bienvenido[playerid],0.5,1.5);
    TextDrawUseBox(bienvenido[playerid], 0);
    TextDrawColor(bienvenido[playerid],0xFF00FFFF);
    TextDrawSetOutline(bienvenido[playerid],1);
    TextDrawSetProportional(bienvenido[playerid],1);
    TextDrawSetShadow(bienvenido[playerid],1);
    return 1;
}
Just take this, and check if it shows. If yes, then change the coords to yours.
Reply
#5

Quote:
Originally Posted by Jeffry
Посмотреть сообщение
Try:

pawn Код:
public TextBienvenido(playerid)
{
    bienvenido[playerid] = TextDrawCreate(10, 175.0, "Bienvenido");
    TextDrawTextSize(bienvenido[playerid],150.000000,120.000000);
    TextDrawAlignment(bienvenido[playerid],0);
    TextDrawFont(bienvenido[playerid],1);
    TextDrawLetterSize(bienvenido[playerid],0.5,1.5);
    TextDrawUseBox(bienvenido[playerid], 0);
    TextDrawColor(bienvenido[playerid],0xFF00FFFF);
    TextDrawSetOutline(bienvenido[playerid],1);
    TextDrawSetProportional(bienvenido[playerid],1);
    TextDrawSetShadow(bienvenido[playerid],1);
    return 1;
}
Just take this, and check if it shows. If yes, then change the coords to yours.
dont works :S..
i send you a pm
Reply
#6

Tested and works:


pawn Код:
forward TextBienvenido(playerid);
forward TerminarBienvenida(playerid);

new Text:bienvenido[MAX_PLAYERS]; //----> Variable TextDraw Bienvenida

public OnPlayerConnect(playerid)
{
    TextBienvenido(playerid);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    TextDrawShowForPlayer(playerid, bienvenido[playerid]);
    SetTimerEx("TerminarBienvenida", 4000, 0, "i", playerid);
    return 1;
}

public TextBienvenido(playerid)
{
    bienvenido[playerid] = TextDrawCreate(10, 175.0, "Bienvenido");
    TextDrawTextSize(bienvenido[playerid],150.000000,120.000000);
    TextDrawAlignment(bienvenido[playerid],0);
    TextDrawFont(bienvenido[playerid],1);
    TextDrawLetterSize(bienvenido[playerid],0.5,1.5);
    TextDrawUseBox(bienvenido[playerid], 0);
    TextDrawColor(bienvenido[playerid],0xFF00FFFF);
    TextDrawSetOutline(bienvenido[playerid],1);
    TextDrawSetProportional(bienvenido[playerid],1);
    TextDrawSetShadow(bienvenido[playerid],1);
    return 1;
}


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

public TerminarBienvenida(playerid)
{
    TextDrawHideForPlayer(playerid, bienvenido[playerid]);
    return 1;
}

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

public OnPlayerDisconnect(playerid, reason)
{
    TextDrawHideForAll(bienvenido[playerid]);
    TextDrawDestroy(bienvenido[playerid]);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)