SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Tutorials

Reply
 
Thread Tools Display Modes
Old 26/09/2012, 03:27 PM   #1
Nirzor
Gangsta
 
Nirzor's Avatar
 
Join Date: Feb 2012
Location: Bangladesh
Posts: 523
Reputation: 60
Exclamation --: Creating Textdraw's In The Easiest Way :-- [Helpful for textdraw creators]

Click Here To Download TextDraw Editor


Today i am going to show a tutorial how to create Permanent Textdraws in the easiest way.

The Textdraw will only disappear upon when a player disconnects.

so to start off with download the textdraw editor i forgot the name of its creator sorry.

place the textdraws in your positions go to your scriptfiles folder and get the codes copy them and paste

it in your script.But i am going to show what each variable works with.

Step 1

create a variable to make the textdraw suppost i give the variable

Code:
new Text:Textdraw0;
so now you have finally created the variable we are done with it.

Step 2

go to
Code:
OnPlayerConnect
function and as i said said before to take the codes from scriptfiles

suppose these are my codes

Code:
 Textdraw0 = TextDrawCreate(487.000000, 7.000000, "gtasamp.smfnew.com");
    TextDrawBackgroundColor(Textdraw0, 255);
    TextDrawFont(Textdraw0, 0);
    TextDrawLetterSize(Textdraw0, 0.679999, 1.500000);
    TextDrawColor(Textdraw0, -16776961);
    TextDrawSetOutline(Textdraw0, 0);
    TextDrawSetProportional(Textdraw0, 1);
    TextDrawSetShadow(Textdraw0, 1);
    TextDrawShowForPlayer(playerid, Textdraw0);
now you are thinking what does this codes have to do with??

ok now listen carefully
Code:
Textdraw0 = TextDrawCreate(487.000000, 7.000000, "gtasamp.smfnew.com");
remember we named a variable with TextDraw0; so this is the work of it we put in the variable name to define

the textdraw we are creating in this line.

Code:
TextDrawFont(Textdraw0, 0);
this is the font style of the textdraw there are 3 styles you can

choose your own and give this function makes the style of the textdraw.

Code:
TextDrawLetterSize(Textdraw0, 0.679999, 1.500000);
this is the function we use to make the

size of the letter as we already got the codes in scriptfiles we can just paste it here for letter size.

Code:
TextDrawColor(Textdraw0, -16776961);
this is the color of textdraw just copy it from scriptfiles

and paste it after the textdraw0 to get your own color of choice but remember don't mess up with other

codes or it will be a total mess.

Code:
TextDrawSetOutline(Textdraw0, 0);
this is the function we are using for defining the outline

of the textdraw so we get a nice outline there are many outlines you can choose for yourselves when editing

a textdraw.

finally these three codes left.

Code:
TextDrawSetProportional(Textdraw0, 1);
    TextDrawSetShadow(Textdraw0, 1);
    TextDrawShowForPlayer(playerid, Textdraw0);
while editing you will see in settings that you can set this so in the settings go and edit and get the codes

in scriptfiles and at last of everything show the textdraw for player so players can see and to mention onething

i did not give OnPlayerDisconnect code because when player disconnects it will automatically go away and this

is a Permanent code not the changing code like others.

then go to on player gamemode init to destroy the textdraw to prevent bugs put

Code:
TextDrawDestroyForPlayer(playerid, Textdraw0);

Thanks for watching my tutorial.

+Rep if it helped you or you liked it!
__________________
Our Gaming Community [UG] Gaming. Join my community today.
[UG] Gaming Forums : www.un-gaming.com

Looking for someone with an advanced TDM script , if you have one contact me on skype : emaz.ahmed7 ill put it on hosted tab.

Last edited by Nirzor; 27/09/2012 at 01:34 PM.
Nirzor is offline   Reply With Quote
Old 26/09/2012, 03:28 PM   #2
Jarnu
Guest
 
Posts: n/a
Default Re: --: Creating Textdraw's In The Easiest Way :-- [Helpful for textdraw creators]

You MUST destroy the TextDraw when the player gets disconnected

OT: Good work..
  Reply With Quote
Old 26/09/2012, 03:49 PM   #3
Nirzor
Gangsta
 
Nirzor's Avatar
 
Join Date: Feb 2012
Location: Bangladesh
Posts: 523
Reputation: 60
Default Re: --: Creating Textdraw's In The Easiest Way :-- [Helpful for textdraw creators]

Thanks guys and i wanted to say i did not destroy the textdraw because its a permanent one no needs of destroying

it and Thanks for the comments
__________________
Our Gaming Community [UG] Gaming. Join my community today.
[UG] Gaming Forums : www.un-gaming.com

Looking for someone with an advanced TDM script , if you have one contact me on skype : emaz.ahmed7 ill put it on hosted tab.
Nirzor is offline   Reply With Quote
Old 26/09/2012, 03:51 PM   #4
Gamer_007
Gangsta
 
Gamer_007's Avatar
 
Join Date: Dec 2011
Location: Connecting...
Posts: 670
Reputation: 11
Default Re: --: Creating Textdraw's In The Easiest Way :-- [Helpful for textdraw creators]

Nice btw the name of creator is Zamaroht.
Gamer_007 is offline   Reply With Quote
Old 26/09/2012, 03:56 PM   #5
Glint
Guest
 
Posts: n/a
Default Re: --: Creating Textdraw's In The Easiest Way :-- [Helpful for textdraw creators]

Quote:
Thanks for watching my tutorial
We did not watch we read
  Reply With Quote
Old 26/09/2012, 03:57 PM   #6
Nirzor
Gangsta
 
Nirzor's Avatar
 
Join Date: Feb 2012
Location: Bangladesh
Posts: 523
Reputation: 60
Default Re: --: Creating Textdraw's In The Easiest Way :-- [Helpful for textdraw creators]

Thanks for the comment +rep for you rep me back if you can and Zamaroht is the creator your right!
__________________
Our Gaming Community [UG] Gaming. Join my community today.
[UG] Gaming Forums : www.un-gaming.com

Looking for someone with an advanced TDM script , if you have one contact me on skype : emaz.ahmed7 ill put it on hosted tab.
Nirzor is offline   Reply With Quote
Old 26/09/2012, 03:58 PM   #7
[MWR]Blood
High-roller
 
Join Date: Apr 2009
Posts: 2,268
Reputation: 105
Default Re: --: Creating Textdraw's In The Easiest Way :-- [Helpful for textdraw creators]

Well, what the fuck?
Why are you creating a global textdraw on the OnPlayerConnect callback?
__________________
[MWR]Blood is offline   Reply With Quote
Old 26/09/2012, 04:14 PM   #8
Nirzor
Gangsta
 
Nirzor's Avatar
 
Join Date: Feb 2012
Location: Bangladesh
Posts: 523
Reputation: 60
Default Re: --: Creating Textdraw's In The Easiest Way :-- [Helpful for textdraw creators]

Man your maybe a bit unpatient see the tutorial carefully that new global thing everyone knows has to be over

gamemode init man
__________________
Our Gaming Community [UG] Gaming. Join my community today.
[UG] Gaming Forums : www.un-gaming.com

Looking for someone with an advanced TDM script , if you have one contact me on skype : emaz.ahmed7 ill put it on hosted tab.
Nirzor is offline   Reply With Quote
Old 27/09/2012, 12:51 AM   #9
newbienoob
High-roller
 
newbienoob's Avatar
 
Join Date: Jan 2012
Location: Follow the moaning coming from your parents' bedroom
Posts: 1,530
Reputation: 270
Default Re: --: Creating Textdraw's In The Easiest Way :-- [Helpful for textdraw creators]

Quote:
Originally Posted by Nirzor View Post
Man your maybe a bit unpatient see the tutorial carefully that new global thing everyone knows has to be over

gamemode init man
Well, then why did you put
pawn Code:
Textdraw0 = TextDrawCreate(487.000000, 7.000000, "gtasamp.smfnew.com");
    TextDrawBackgroundColor(Textdraw0, 255);
    TextDrawFont(Textdraw0, 0);
    TextDrawLetterSize(Textdraw0, 0.679999, 1.500000);
    TextDrawColor(Textdraw0, -16776961);
    TextDrawSetOutline(Textdraw0, 0);
    TextDrawSetProportional(Textdraw0, 1);
    TextDrawSetShadow(Textdraw0, 1);
under OnPlayerConnect? Just put all of them under OnGameModeInit and put TextDrawShowForPlayer under OnPlayerConnect.
__________________
Help me, please /a chat
newbienoob is offline   Reply With Quote
Old 27/09/2012, 03:13 AM   #10
Amit_B
Huge Clucker
 
Amit_B's Avatar
 
Join Date: Nov 2007
Location: Israel
Posts: 349
Reputation: 69
Default Re: --: Creating Textdraw's In The Easiest Way :-- [Helpful for textdraw creators]

Well yes, the text wil disappear automatically when the player disconnect, but what about destroying it? The fact that the player can't see the text don't mean it doesn't exists. After having a lot of textdraws created the textdraws will not work fine as they did worked for you following your own steps.

Also, you need to notice the global variable defined in OnPlayerConnect as everyone pointed.

Before calling your tutorial "the easiest way" and also "helpful" you should check it well! Checking it on a server only by yourself and not on a real server would just get you understand things with the wrong way, just as you got the textdraws thing.
__________________
- Leading the Israeli SA-MP Community, SA-MP.co.il - SAMP-IL
- Currently working on the first anime project on SA-MP, Naruto Shippuden gamemode: #1, #2, #3

https://github.com/Amit-B/
Amit_B is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a Textdraw on PlayerRequestClass HazardGaming Scripting Help 2 08/04/2012 02:34 PM
[Help] - Creating Textdraw xRyder Help Archive 5 18/02/2011 04:31 AM
Are you the GTA SA MP creators? Calcor General 8 14/01/2009 03:43 PM


All times are GMT. The time now is 09:37 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.