[Map] Making a HelpBot[As a textdraw]
#1

Hi guys,I decided to make a tutorial about how to make a simple helpbot (as textdraw)
First, let's define the text-draw.


pawn Code:
new Text:Txt;
Now let's create the messages that you want to show.
pawn Code:
new HelpBot[][]=
{
"Add <IP Here> To your favourites!",
"Visit our forums at ...",
"Read the /rules before playing",
"If you're a newbiehere, please read /help"
};
After that, we will have to create the textdraw.
pawn Code:
Txt = TextDrawCreate(2.000000, 429.000000, " ");
    TextDrawAlignment(Txt, 0);
    TextDrawBackgroundColor(Txt, 0xffffff33);
    TextDrawFont(Txt, 1);
    TextDrawLetterSize(Txt, 0.299999, 1.300000);
    TextDrawColor(Txt, 0x0000ff99);
    TextDrawSetOutline(Txt, 1);
    TextDrawSetProportional(Txt, 1);
    TextDrawSetShadow(Txt, 1);
We just created the textdraw.
We should create a public function which displays the messages randomly.
pawn Code:
forward Bot();
public Bot()
{
TextDrawSetString(Text:Txt, HelpBot[random(sizeof(HelpBot))]);
return 1;
}
Now, let's set a timer which will change the messages.
pawn Code:
SetTimer("Bot",20000,1); //The messages will randomly change every 20 seconds.
Now we have to show the textdraw to the player!
Put the following code after OnPlayerConnect, or after OnPlayerSpawn.
[pawn]TextDrawShowForPlayer(playerid,Txt);/pawn]

And,DONE!
Reply
#2

Not a tutorial, you need to explain things rather than just rush into 'And, DONE!'

This is more like 'HOW TO CREATE A RANDOM MESSAGE TEXTDRAW'
How can you call this a HELPBOT when there's no NPC/BOT connected?

I appreciate that you're trying to create tutorials to help people, but this way nobody will learn, they'll just end up copy-pasting what you posted
Reply
#3

I'm pretty new with scripting and didn't understand any of this.
Reply
#4

....
Reply
#5

Then if you made a tutorial whats the point in making it if you dont no how to explain. for me if i asked you what does this do. SetTimer("Bot",20000,1); what does it mean why would i need it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)