Making a HelpBot as a textdraw -
[MWR]Blood - 11.12.2010
Hello, I was bored as hell and I decided to make a tutorial about how to make a simple helpbot (as textdraw)
For first, let's define the textdraw.
Great! Now let's create the messages that you want to appear.
pawn Код:
new HelpBot[][]=
{
"Add <IP Here> To your favourites!",
"Visit our forums at ...",
"Read the /rules before playing",
"If you're a newbie here, please read /help"
};
Well done!
After that, we will have to create the textdraw.
pawn Код:
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);
Very nice!
We just created the textdraw.
What now? We should create a public function which displays randomly the messages.
pawn Код:
forward Bot();
public Bot()
{
TextDrawSetString(Text:Txt, HelpBot[random(sizeof(HelpBot))]);
return 1;
}
Almost done!
Now, let's set a timer which will change the messages.
pawn Код:
SetTimer("Bot",20000,1); //The messages will randomly change every 20 seconds.
The final thing: Now we have to show the textdraw to the player!
Put the following code after OnPlayerConnect, or after OnPlayerSpawn.
pawn Код:
TextDrawShowForPlayer(playerid,Txt);
We're done!
Re: Making a HelpBot as a textdraw -
HyperZ - 11.12.2010
Nice Tutorial. :P
Re: Making a HelpBot as a textdraw -
WillyP - 11.12.2010
Kewl for newbz.
Re: Making a HelpBot as a textdraw -
Jantjuh - 11.12.2010
good tut!
-j
Re: Making a HelpBot as a textdraw -
MestreKiller - 11.12.2010
settimer is global when you have with playerid
pawn Код:
SetTimer(playerid,"Bot",20000,1); //The messages will randomly change every 20 seconds.
it will give error
it should be settimerex
Re: Making a HelpBot as a textdraw -
Stefan_Toretto - 11.12.2010
Good Tutorial for Beginers
Re: Making a HelpBot as a textdraw -
[MWR]Blood - 12.12.2010
Quote:
Originally Posted by [OC]MestreKiller
settimer is global when you have with playerid
pawn Код:
SetTimer(playerid,"Bot",20000,1); //The messages will randomly change every 20 seconds.
it will give error
it should be settimerex
|
Not really. Try it if you want to, I bet it's not going to work.
Re: Making a HelpBot as a textdraw -
MestreKiller - 12.12.2010
Quote:
Originally Posted by Delux13
Not really. Try it if you want to, I bet it's not going to work.
|
how the fuck can you try settimer(playerid ? ofc its gunna give error!!!!!!
i just tryed and it sayed error
see the diference between
this and
this
Re: Making a HelpBot as a textdraw -
[MWR]Blood - 13.12.2010
Quote:
Originally Posted by [OC]MestreKiller
how the fuck can you try settimer(playerid ? ofc its gunna give error!!!!!!
i just tryed and it sayed error
see the diference between this and this
|
FFS yeah, i was abit sleepy
Edited it now though
Re: Making a HelpBot as a textdraw -
MestreKiller - 13.12.2010
Quote:
Originally Posted by Delux13
FFS yeah, i was abit sleepy
Edited it now though
|
ahh!!! now it works fine
for your comprehension 8/10
Re: Making a HelpBot as a textdraw -
The_Gangstas - 13.12.2010
any pics of the textdraw?
Re: Making a HelpBot as a textdraw -
Mean - 25.12.2010
Love it better as a Message, still good.