SA-MP Forums Archive
[Map] Making a HelpBot[As a textdraw] - 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: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Map] Making a HelpBot[As a textdraw] (/showthread.php?tid=439021)



Making a HelpBot[As a textdraw] - Lagger321 - 23.05.2013

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!



Re: Making a HelpBot[As a textdraw] - CreativityLacker - 23.05.2013

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


Re: Making a HelpBot[As a textdraw] - mahony0509 - 23.05.2013

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


Re: Making a HelpBot[As a textdraw] - Ryan_Bowe - 23.05.2013

....


Re: Making a HelpBot[As a textdraw] - OpticKiller - 23.05.2013

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?