Author Topic: Infection on death  (Read 3905 times)

Thats what he's done.

Quote
Code: [Select]
%client.MonsterfyPls = !%client.MonsterfyPls;[/quote]
I'm not used to doing that type of changing so I'm clueless on the changing part.

use %this.setDatablock(datablock);

....Like i said im clueless for that, I want it to go  between Dhuman and Dcreature.

what he wants is a dead body to turn into a bot that will do what ever
ex:

1. player gets killed

2. the body of the dead player "revives" aka gets up

3. the body attacks other players.


in other words he wants a script so that the player, when killed, will turn into a bot

(to much info?)

I believe what he really wants is, simply.

2 teams, we will call them Humans and Others for an example.

An other kills a human, said human, when respawned, will become an other, and nice versa. Human kills other, other becomes human.

The way you'd do this is: (lol, pseudo code)

Code: [Select]
function GameConnection::OnClientEnterGame(%this)
{
//split up teams evenly here by looping through all players, checking their teams, seeing which has less players, put them in that team.
parent::OnClientEnterGame(%this);
}

function PlayerStandardArmor:OnDeath(%this,%personwhokilledthem)
{
if(%this.team != %personwhokilledthem.team)
     {
     %this.team = %personwhokilledthem.team;
     parent::ondeath(%this,%personwhokilledthem);
     }
else {
parent::ondeath(%this,%personwhokilledthem);
}

Note: This is based on theory, not actual function names or variable names.

Code: [Select]
for(%i=0;%i<ClientGroup.getCount();%i++){
         %cl = ClientGroup.getObject(%i);
         %cl.Backup();
         if(%team){
            %cl.team = 0;
            %cl.player.kill();
            %team = 0;
         } else {
            %cl.team = 1;
            %cl.player.kill();
            %team = 1;
         }
}

That'll split the players.
« Last Edit: June 29, 2007, 02:45:12 PM by MrPickel »

Code: [Select]
for(%i=0;%i<ClientGroup.getCount();%i++){
         %cl = ClientGroup.getObject(%i);
         %cl.Backup();
         if(%team){
            %cl.team = 0;
            %cl.player.kill();
            %team = 0;
         } else {
            %cl.team = 1;
            %cl.player.kill();
            %team = 1;
         }
}
...
You forgot a bracket, not big, but I added it for you...

Oh Yeah Thanks. Ill Edit.

Does anyone have a solution yet?

For what we answered everything you asked.