Author Topic: Camera weirdness  (Read 491 times)

I am trying to make a immobilized player when he gets enough damage, then go back to normal if he gets healed.
The thing is that the camera does not seem the work as it should.

To change the camera to the "admin-spy on yourself" or "ski falling", I thought it was like:

%player.client.camera.setMode(corpse, %player);
%player.client.setControlObject(%player.client.camera);

But it only works the second time I get damage

Code:
Quote
package FaintingPlayer{

function Armor::onDamage(%data,%player,%slot,%io)
{
if(%player.getDamageLevel() > 100){

%player.setWhiteout(0.5);
commandtoclient(%player.client,'centerPrint',"<color:ffffff>You fainted!",5);

%player.setvelocity("0 0 0");

%player.client.camera.setMode(corpse, %player);
%player.client.setControlObject(%player.client.camera);

}
Parent::onDisabled(%data, %obj, %enabled);
}

function Armor::onHeal(%data,%player,%slot,%io)
{

%player.client.setControlObject(%player);

}
Parent::onHeal(%data, %obj, %enabled);
}


Also I am still able to shoot and click stuff
Not only that but when changing datablock, I get back out.

I haven't come to test the healing bit, so it will be full of errors too =P