Author Topic: How to have 1 life per minigame in Gamemodes?  (Read 1051 times)

/title

What's the code for it, it's not in rotondo's modification topic.

It's not in rotondo's mod topic because it isn't a default supported function

You'll have to script it manually. Take some traces of when the player dies and respawns and try and edit those functions.

^^^^
Not my profession, I'm only good at scripting weapons and tools :I

I'd happily help you but I am on vacation at the moment.


Code: [Select]
package package_name
{
function miniGameSO::removeMember( %this, %cl )
{
%cl.isDead = "";
parent::removeMember( %this, %cl );
}

function miniGameSO::reset( %this, %cl )
{
for ( %i = 0 ; %i < %this.numMembers ; %i++ )
{
%this.member[ %i ].isDead = "";
}

parent::reset( %this, %cl );
}

function gameConnection::createPlayer( %this, %transform )
{
%this.isDead = "";
return parent::createPlayer( %this, %transform );
}

function gameConnection::onDeath( %this, %pl, %cl, %type, %loc )
{
parent::onDeath( %this, %pl, %cl, %type, %loc );
messageClient( %this, 'MsgYourSpawn' );

%this.isDead = true;
%this.centerPrint( "\c5You are dead.", 2 );
}

function observer::onTrigger( %this, %obj, %slot, %val )
{
if ( !%obj.client.isDead )
{
return parent::onTrigger( %this, %obj, %slot, %val );
}
}
};

activatePackage( "package_name" );


Except that ports code did nothing for me


Well we fixed it in the end now didn't we, Mold?


« Last Edit: August 14, 2012, 02:45:43 AM by Electrk »