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)
+--- Thread: Textdraws (/showthread.php?tid=394093)



Textdraws - Joshswag - 21.11.2012

Hey guys, I'm trying to add a textdraw to the server im scripting for, this is what i've done.
I've added.
Code:
new Text:Website;
and under onplayerconnect i've added
Code:
{
 	Website = TextDrawCreate(320.00, 80.00, "Website URL: www.csroleplay.net");
    TextDrawBackgroundColor(Website, 255);
    TextDrawFont(Website, 0);
    TextDrawLetterSize(Website, 0.679999, 1.500000);
    TextDrawColor(Website, COLOR_CIVILIAN);
    TextDrawSetOutline(Website, 0);
    TextDrawSetProportional(Website, 1);
    TextDrawSetShadow(Website, 1);
    TextDrawShowForPlayer(playerid, Website)
}
Does anyone know what i've done wrong? Thanks in advance. (This broke my compiler)


Re: Textdraws - Bicentric - 21.11.2012

pawn Code:
Website = TextDrawCreate(320.00, 80.00, "Website URL: www.csroleplay.net");
    TextDrawBackgroundColor(Website, 255);
    TextDrawFont(Website, 0);
    TextDrawLetterSize(Website, 0.679999, 1.500000);
    TextDrawColor(Website, COLOR_CIVILIAN);
    TextDrawSetOutline(Website, 0);
    TextDrawSetProportional(Website, 1);
    TextDrawSetShadow(Website, 1);
     //    TextDrawShowForPlayer(playerid, Website) < Nope
Move that code to OnGameModeInit, you only create TextDraws when a player connects if it's a PlayerTextdraw.

And you're also missing a brackets on this line.

pawn Code:
TextDrawShowForPlayer(playerid, Website)
Anyway, this is the thing what should be OnPlayerConnected

pawn Code:
TextDrawShowForPlayer(playerid, Website);



Re: Textdraws - Glad2BeHere - 21.11.2012


pawn Code:
new Text:Website;

public OnGameModeInit()
{
    Website = TextDrawCreate(320.00, 80.00, "Website URL: www.csroleplay.net");
    TextDrawBackgroundColor(Website, 255);
    TextDrawFont(Website, 0);
    TextDrawLetterSize(Website, 0.679999, 1.500000);
    TextDrawColor(Website, -1);
    TextDrawSetOutline(Website, 0);
    TextDrawSetProportional(Website, 1);
    TextDrawSetShadow(Website, 1);
    return 1;
}

public OnPlayerConnect(playerid)
{
    TextDrawShowForPlayer(playerid, Website);
    return 1;
}
PS: Want me to fix and make it better


Re: Textdraws - Joshswag - 21.11.2012

it should be in the bottom middle of the screen.


Re: Textdraws - Glad2BeHere - 21.11.2012

well i am using your code, let me make a custom one brb with it


Re: Textdraws - Joshswag - 21.11.2012

And my compiler still breaks


Re: Textdraws - Glad2BeHere - 21.11.2012

then it cannot be textdraw, if it freezes up just wait and ensure it compiled, sometimes the compiler freezes, but it just dont compile at all


Re: Textdraws - Joshswag - 21.11.2012

It tells me, the compiler has stopped working.


Re: Textdraws - Joshswag - 21.11.2012

http://prntscr.com/k8ady


Re: Textdraws - Glad2BeHere - 21.11.2012



pawn Code:
new Text:Website; //ensure this somewhere at the top

public OnGameModeInit()
{
    Website = TextDrawCreate(193.600021, 427.093536, "Website URL: www.csroleplay.net");
    TextDrawLetterSize(Website, 0.449999, 1.600000);
    TextDrawAlignment(Website, 1);
    TextDrawColor(Website, -1);
    TextDrawSetShadow(Website, 0);
    TextDrawSetOutline(Website, 1);
    TextDrawBackgroundColor(Website, 51);
    TextDrawFont(Website, 0);
    TextDrawSetProportional(Website, 1);
    return 1;
}

public OnPlayerConnect(playerid)
{
    TextDrawShowForPlayer(playerid, Website);
    return 1;
}
If you pawno is compiling paste the whole code here or in pastebin and send it imma try and fix

PS: COPY and paste everything i showed you and it will work