SA-MP Forums Archive
Textdraws - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Textdraws (/showthread.php?tid=217067)



Textdraws - Anthonyx3' - 27.01.2011

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?


Re: Textdraws - Grim_ - 27.01.2011

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.


Re: Textdraws - Anthonyx3' - 27.01.2011

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?


Re: Textdraws - Grim_ - 27.01.2011

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.


Re: Textdraws - -Rebel Son- - 27.01.2011

Код:
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


Re: Textdraws - Gabe - 27.01.2011

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);
}



Re: Textdraws - Anthonyx3' - 27.01.2011

Ah, thanks alot guys