Textdraws
#1

Hey guys, is it possible to use textdraws on, onplayerconnect? Like for example i have:

pawn Код:
public OnPlayerConect(playerid){
Textdraw0 = TextDrawCreate(5.000000, 184.000000, "Welcome To New Legends Evolution");
    TextDrawBackgroundColor(Textdraw0, 255);
    TextDrawFont(Textdraw0, 3);
    TextDrawLetterSize(Textdraw0, 0.480000, 1.900000);
    TextDrawColor(Textdraw0, 16711935);
    TextDrawSetOutline(Textdraw0, 1);
    TextDrawSetProportional(Textdraw0, 1);
return 1;
}
Am i doing this wrong? Or is it just not possible to use on onplayerconnect?


Also, is there a shorter way of adding textdraws?
Reply
#2

Yes, it's possible. And you would be better off creating a global textdraw in OnGameModeInit and then showing it to the player as they connect.
Reply
#3

I don't know much about textdraws, considering this is my first time making it. How would i make ongamemodeinit, without it showing up unless i use w.e function is it that shows textdraws on onplayerconnect?
Reply
#4

Create the textdraw and apply the functions to it as you would. Then, when the player connects, show it to him.
pawn Код:
public OnGameModeInit( )
{
    Textdraw0 = TextDrawCreate(5.000000, 184.000000, "Welcome To New Legends Evolution");
    TextDrawBackgroundColor(Textdraw0, 255);
    TextDrawFont(Textdraw0, 3);
    TextDrawLetterSize(Textdraw0, 0.480000, 1.900000);
    TextDrawColor(Textdraw0, 16711935);
    TextDrawSetOutline(Textdraw0, 1);
    TextDrawSetProportional(Textdraw0, 1);
    return 1;
}

public OnPlayerConnect( playerid )
{
    TextDrawShowForPlayer( playerid, Textdraw0 );
    return 1;
}
You will need to make sure you declare 'Textdraw0' variable globally.
Reply
#5

Код:
Textdraw0 = TextDrawCreate(5.000000, 184.000000, "Welcome To New Legends Evolution");    TextDrawBackgroundColor(Textdraw0, 255);    TextDrawFont(Textdraw0, 3);    TextDrawLetterSize(Textdraw0, 0.480000, 1.900000);    TextDrawColor(Textdraw0, 16711935);    TextDrawSetOutline(Textdraw0, 1);    TextDrawSetProportional(Textdraw0, 1);
Then on OnPlayerConnect put TextdrawShowForPlayer

Then on Remove it whith TextdrawHideForPlayer
Reply
#6

pawn Код:
new Text:Logo;


public OnGameModeInit()
{
   
    Logo = TextDrawCreate(320.0, 100.0, "My Text");
    TextDrawSetOutline(Logo, 1);
    TextDrawFont(Logo, 3);
    TextDrawBackgroundColor(Logo, 0xFFFFFFFF );
    TextDrawAlignment(Logo, 2);
    TextDrawLetterSize(Logo, 2.0 ,7.5);
    return(1);
}

public OnPlayerConnect( playerid )
{
   
    TextDrawShowForPlayer(playerid, Logo);
    return(1);
}

public OnPlayerSpawn( playerid )
{
    TextDrawHideForPlayer(playerid, Logo);
    return(1);
}
Reply
#7

Ah, thanks alot guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)