Author Topic: What's the code for the onPlayerTouch event  (Read 882 times)

I need the code for the onPlayerTouch event, i'm going to register another event that has the same aspect as onPlayerTouch (checking if a client made contact with the brick), but I want it to do a little check first, so can anyone give me the code for this event?

I think it would be this:

function onPlayerTouchCheck(params)
{
//do check here
Parent::onPlayerTouch(params);
}

edit: to clarify, i don't know much about registering input/output events, this is just a guess

It's hard coded into the game. You'll have to rewrite it.

try using onPlayerFirstTouch for a template?

Nevermind.. I'll just make an output event called from onPlayerTouch in the events GUI, which'll call the new event I was gonna make

Do it like this.

Code: [Select]
package whatever
{
function fxDtsBrick::onPlayerTouch(%this,%player)
{
parent::onPlayerTouch(%this,%player);

if(%player.getClassName() !$= "Player")
return;

%client = %player.client;

%mini = getMinigameFromObject(%client);
if(!isSlayerMinigame(%mini))
return;

%team = %client.getTeam();
if(!isObject(%team))
return;

$InputTarget_["Self"] = %this;
$InputTarget_["Player"] = %player;
$InputTarget_["Client"] = %client;
$InputTarget_["MiniGame"] = %mini;
%this.processInputEvent("onPlayerTouch(Team" @ %team.getGroupID() + 1 @ ")",%client);
}
};
activatePackage(whatever);