DIR Return Create A Forum - Home
---------------------------------------------------------
The Ultimate Knifing Clan Forum
HTML https://tukcforum.createaforum.com
---------------------------------------------------------
*****************************************************
DIR Return to: Add-on Help
*****************************************************
#Post#: 2424--------------------------------------------------
How to use parent and packages
By: Lt. Jamergaman Date: April 12, 2012, 6:37 pm
---------------------------------------------------------
Ok, for all of you that are new to scripting/programming in
Blockland-Add-ons, then this tutorial is for you.
You can either go to the Blockland forums to get your tutorial
there that Badspot made and Spaceguy, but I'm just gonna make my
own.
First of all, packaging means you are packaging a whole pack of
code that can be executed at once and activated/deactivated if
you don't want to use it, deactivate it, if you want to use it,
activate it.
For example:
[code]//example
//normally packages activate whence executed
package test
{
function on() //you can use this to activate it
{
echo("Your package is activated!");
}
};
activatepackage(test);
function off() //you can use this to deactivate it
{
deactivatepackage(test);
echo("Your package has been deactivated!");
}[/code]
Now, onto parents.
Parents are the default function of a function that you are
overwriting or for a client function.
If you use a chatbot, and you're using [font=andale
mono]clientcmdchatmessage(%cp,%name,%cs,%fmsg,%msg)[/font] then
you're gonna have to parent it by [font=andale
mono]parent::clientcmdchatmessage(%cp,%name,%cs,%fmsg,%msg);[/fo
nt].
That is for beginners, and most advanced is where you can only
use yourself so the host nor SA's with eval can't talk as you
and your chatbot doesn't callback. Parent is also used for
calling back the default function after overwriting it.
For example:
[code]function Gameconnection::onClientEnterGame(%cl)
{
Parent::onClientEnterGame(%cl); //if this doesn't
work, try putting it after the code before the ending bracket
echo("Player spawned even though it already shows the
player spawned in console.");
}[/code]
I hope you guys understand this, if there needs to be more to
added to this, please tell me.
#Post#: 2438--------------------------------------------------
Re: How to use parent and packages
By: Deoxys And One Noob Date: April 13, 2012, 9:38 pm
---------------------------------------------------------
Reported for misboarded topic
#Post#: 2439--------------------------------------------------
Re: How to use parent and packages
By: Mr.Undead435 Date: April 14, 2012, 12:00 am
---------------------------------------------------------
^^^ /Disagree,
This is chat add-on help if you want to make something, Stop
reporting things randomly.
(Just like you reporting me for cussing.)
#Post#: 2440--------------------------------------------------
Re: How to use parent and packages
By: Lt. Jamergaman Date: April 14, 2012, 3:15 am
---------------------------------------------------------
[quote author=Deoxys And One Noob link=topic=290.msg2438#msg2438
date=1334371118]
Reported for misboarded topic
[/quote]You have missed the whole subject.
2. Jakob and I made these forums, so I know where to post.
#Post#: 3017--------------------------------------------------
Re: How to use parent and packages
By: Wrapperup Date: May 30, 2012, 3:22 pm
---------------------------------------------------------
You did miss 1 part of the package, although im sure you fixed
this in your newer scripts
You need to add a ; to the end of your package brackets
Example:
[code]package test
{
function on()
{
echo("the package was enabled!");
}
};[/code]
Don't forget the ; in there!
Thats all I wanted to state.
thanks
Also, the
[code]activatepackage(PACKAGE);[/code]
is optional, you need it to activate the package at anytime.
thanks
;D
and yes, i just did reply on an old topic.
#Post#: 3018--------------------------------------------------
Re: How to use parent and packages
By: Cat123 Date: May 30, 2012, 3:46 pm
---------------------------------------------------------
[quote author=Wrapperup link=topic=290.msg3017#msg3017
date=1338409371]
You did miss 1 part of the package, although im sure you fixed
this in your newer scripts
You need to add a ; to the end of your package brackets
Example:
[code]package test
{
function on()
{
echo("the package was enabled!");
}
};[/code]
Don't forget the ; in there!
Thats all I wanted to state.
thanks
Also, the
[code]activatepackage(PACKAGE);[/code]
is optional, you need it to activate the package at anytime.
thanks
;D
and yes, i just did reply on an old topic.
[/quote]
Lol, why all this?
1st - You made a shitty version of cohost, when you could just
add the cmds / Please, make your own add-ons, we do not need
remakes, It's waste of time
2nd - Youre making basic tutorials / People who needs help may
ask there, no tutorials needed (Keep the tutorial)
3rd - Complaining about One line of fail / Lt. Jamergaman's
The heck is wrong with you? :/
#Post#: 3022--------------------------------------------------
Re: How to use parent and packages
By: Wrapperup Date: May 30, 2012, 5:42 pm
---------------------------------------------------------
@Cat
I made the mod before i even knew you made one ok?
please, just.
:-\
#Post#: 3026--------------------------------------------------
Re: How to use parent and packages
By: Cat123 Date: May 30, 2012, 7:32 pm
---------------------------------------------------------
[quote author=Wrapperup link=topic=290.msg3022#msg3022
date=1338417775]
@Cat
I made the mod before i even knew you made one ok?
please, just.
:-\
[/quote]
Not much time ago, so, yeah :P
I made my Co-Host in... February? (Maybe March)
#Post#: 3028--------------------------------------------------
Re: How to use parent and packages
By: Wrapperup Date: May 30, 2012, 7:59 pm
---------------------------------------------------------
@ Cat
Is my script really THAT bad?
I had an expert to check it out, he said it was aight.
Also, im not trying to start an argument, but i had the idea of
co-host before i could script, so i took moderator and turned it
into hell (lol)
But eh, yea.
(I think that was during my last summer break or so.)
;)
*****************************************************