Blockland Forums > Modification Help
Messaging in a package?
tyler0:
Here is my code. Whats wrong with it?
--- Code: ---package NewPackage
{
function paintProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
%c = %this.player.client;
commandtoclient(%c,'centerprint',"Hey!",2);
Parent::onCollision(%this,%obj,%col,%fade,%pos,%normal);
}
};
activatePackage(NewPackage);
--- End code ---
Crysist:
commandtoclient(%c,'centerprint',"HEy!",2);
Never defined %c.
otto-san:
--- Quote from: Crysist on July 14, 2010, 02:42:53 PM ---commandtoclient(%c,'centerprint',"HEy!",2);
Never defined %c.
--- End quote ---
this
you should add something like
%c = %this.player.client;
tyler0:
so it would be:
--- Code: ---%c = %this.player.client;
package NewPackage
{
function paintProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
commandtoclient(%c,'centerprint',"HEy!",2);
Parent::onCollision(%this,%obj,%col,%fade,%pos,%normal);
}
};
activatePackage(NewPackage);
--- End code ---
:/ didn't work
Destiny/Zack0Wack0:
No put the %c = * part in the function, silly.