SA-MP Forums Archive
TextDraw Problem - 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: TextDraw Problem (/showthread.php?tid=510346)



TextDraw Problem - RedbullGD - 30.04.2014

Hey Guys.Hope Everything's Fine.
Guys i'm having this simple problem.Can u tell me why is this happening?
So the problem is that i want 3 textdraws on screen 1st is on right,2nd is on left,3rd is in the bottom which is not showing i don't know why.
Here is my script.
Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>


public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" test");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

public OnPlayerConnect(playerid)
{

    MyTextDraw(playerid);
    
	return 1;
}


MyTextDraw(playerid)
{
new Text:leftsidetext;
leftsidetext = TextDrawCreate(1, 206, "/cmds/teles/rules");
TextDrawFont(leftsidetext , 1);
TextDrawLetterSize(leftsidetext , 0.4, 1.4);
TextDrawColor(leftsidetext , 0xFF00FFFF);
TextDrawSetOutline(leftsidetext , 1);
TextDrawSetProportional(leftsidetext , 1);
TextDrawSetShadow(leftsidetext , 0);
TextDrawShowForPlayer(playerid, leftsidetext);
new Text:rightsidetext;
rightsidetext = TextDrawCreate(470, 206, "stunt/drift/race/parkour");
TextDrawFont(rightsidetext , 1);
TextDrawLetterSize(rightsidetext , 0.4, 1.4);
TextDrawColor(rightsidetext , 0xFF00FFFF);
TextDrawSetOutline(rightsidetext , 1);
TextDrawSetProportional(rightsidetext , 1);
TextDrawSetShadow(rightsidetext , 0);
TextDrawShowForPlayer(playerid, rightsidetext);
new Text:ip;
ip = TextDrawCreate(223, 462, "Server IP:176.31.103.65:11980");
TextDrawFont(ip , 1);
TextDrawLetterSize(ip , 0.4, 1.4);
TextDrawColor(ip , 0x00FFFFFF);
TextDrawSetOutline(ip , 1);
TextDrawSetProportional(ip , 1);
TextDrawSetShadow(ip , 0);
TextDrawShowForPlayer(playerid,ip);
}
Thanks In Advance


Re: TextDraw Problem - Pottus - 30.04.2014

You can't keep creating TD's like this eventually you will use all 2000


Re: TextDraw Problem - RedbullGD - 01.05.2014

Quote:
Originally Posted by Rehasher
Посмотреть сообщение
Right well first off why are you creating global textdraws everytime someone connects? You just need to create them once on the OnGameModeInit unless they're PlayerTextdraws.

I made you a better code.

pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>

new Text:ServerTextdraw[3];

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" test");
    print("--------------------------------------\n");
    CreateTextdraws();
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

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

stock CreateTextdraws()
{
    ServerTextdraw[0] = TextDrawCreate(1, 206, "/cmds/teles/rules");
    TextDrawFont(ServerTextdraw[0] , 1);
    TextDrawLetterSize(ServerTextdraw[0] , 0.4, 1.4);
    TextDrawColor(ServerTextdraw[0] , 0xFF00FFFF);
    TextDrawSetOutline(ServerTextdraw[0] , 1);
    TextDrawSetProportional(ServerTextdraw[0] , 1);
    TextDrawSetShadow(ServerTextdraw[0] , 0);

    ServerTextdraw[1] = TextDrawCreate(470, 206, "stunt/drift/race/parkour");
    TextDrawFont(ServerTextdraw[1] , 1);
    TextDrawLetterSize(ServerTextdraw[1] , 0.4, 1.4);
    TextDrawColor(ServerTextdraw[1], 0xFF00FFFF);
    TextDrawSetOutline(ServerTextdraw[1] , 1);
    TextDrawSetProportional(ServerTextdraw[1] , 1);
    TextDrawSetShadow(ServerTextdraw[1] , 0);

    ServerTextdraw[2] = TextDrawCreate(223, 462, "Server IP:176.31.103.65:11980");
    TextDrawFont(ServerTextdraw[2] , 1);
    TextDrawLetterSize(ServerTextdraw[2] , 0.4, 1.4);
    TextDrawColor(ServerTextdraw[2] , 0x00FFFFFF);
    TextDrawSetOutline(ServerTextdraw[2] , 1);
    TextDrawSetProportional(ServerTextdraw[2] , 1);
    TextDrawSetShadow(ServerTextdraw[2] , 0);
}

stock ShowServerTextdraws(playerid)
{
    TextDrawShowForPlayer(playerid, ServerTextdraw[0]);
    TextDrawShowForPlayer(playerid, ServerTextdraw[1]);
    TextDrawShowForPlayer(playerid, ServerTextdraw[2]);
}
Rehaser I don't know how to thank you but all i can do is say
Thank You. & i'll do repp++