Page 1 of 1

[REQUEST] /me Mutator

PostPosted: Fri Jan 18, 08 10:52 pm
by Dex
Could someone make a mutator, where if you type in:

Code: Select all
mutate me slaps himself around his face.


and your name in-game is for example... TheGod

it would show off like this:

Code: Select all
TheGod slaps himself around his face.




...Could someone make it?


Alex, you are so cool at coding... :roll:

PostPosted: Fri Jan 18, 08 11:01 pm
by Alex
Code: Select all
//=============================================================================
// MeMutator Made by Alex ~ http://www.dxalpha.com/
//=============================================================================
class MeMutator extends Mutator;

function PostBeginPlay()
{
  Level.Game.BaseMutator.AddMutator(Self);
}

function Mutate (String S, PlayerPawn Player)
{
  local DeusExPlayer      _Player;
  local string         _Message;

  _Player = DeusExPlayer(Player);

  if(_Player != None)
  {
    if(Left(S,2) ~= "me" && (Left(S,3) ~= "me " || Left(S,3) ~= "me"))
    {
      _Message = Right(S,Len(S)-3);
      if(Len(_Message) > 0)
      {
        BroadcastMessage(_Player.PlayerReplicationInfo.PlayerName$"("$_Player.PlayerReplicationInfo.PlayerID$")"@_Message);
        Log(_Player.PlayerReplicationInfo.PlayerName$"("$_Player.PlayerReplicationInfo.PlayerID$")"@_Message);
      }
      else
      {
        _Player.ClientMessage("|p3<MiniMachina> Usage: Mutate Me [Action]");
      }
    }   
  }   
  Super.Mutate(S,Player);
}

defaultproperties
{
  bHidden=True
}


Should work. Haven't tested.

PostPosted: Fri Jan 18, 08 11:22 pm
by Dex
Okay. I'm gonna test it.

PostPosted: Sat Jan 19, 08 12:21 am
by Dex
========================
Image
========================

This shows up when I start up the server, it says LOADING... and then after 3 seconds it crashes and theCritical Error screen from above is seen.

PostPosted: Sat Jan 19, 08 12:29 am
by Dae
Install it as ServerActors=package.MeMutator in DeusEx.ini.

PostPosted: Sat Jan 19, 08 12:29 am
by Dex
Dae[A] wrote:Install it as ServerActors=package.MeMutator in DeusEx.ini.


That's what I did, don't think I am stupid

BTW, I named the package MeMutator, so it's gonna be MeMutator.MeMutator

PostPosted: Sat Jan 19, 08 12:32 am
by Dex
Here it is.

PostPosted: Fri Feb 15, 08 3:45 am
by SnakeEater
sheesh always needed one of those, don't need a chattering noise when it says what you did XD

PostPosted: Fri Feb 15, 08 12:06 pm
by VodunLoas
I've had a problem with a class name being the same as the package once (I believe), maybe try changing one of them.

PostPosted: Fri Feb 15, 08 1:06 pm
by ynnaD
Dae[A] wrote:Install it as ServerActors=package.MeMutator in DeusEx.ini

That's what I did, don't think I am stupid



way to show ur appreciation there

PostPosted: Fri Feb 15, 08 4:12 pm
by Baleout
¤[ß2S]¤0o7 wrote:
Dae[A] wrote:Install it as ServerActors=package.MeMutator in DeusEx.ini

That's what I did, don't think I am stupid



way to show ur appreciation there


He didn't appreciate it; he was only annoyed that Dae thought he wouldn't have done that.

PostPosted: Fri Feb 15, 08 10:31 pm
by SnakeEater
wow XD
I almost tried making a mutator but it fails :P