Author Topic: God Mode  (Read 1746 times)

Here is what I am trying to do.
I am trying to make a god mode that will give you 5 items (Already got them down) and make you invinsible. Wouldn't this be correct for that?
Code: [Select]
functionServerCmdGod
{
package invincible {
   function GameConnection::onDeath(%killed)
   {
      if(%killed.isGod)
         return;
      parent::onDeath(%killed,%variables);
   }
};
activatePackage(invincible);


{
         %client.player.tool[0] = nametoID(MMWand);
messageClient(%client, 'MsgItemPickup', '', 0, nametoID(MMWand));
%client.player.tool[1] = nametoID(KeyItem);
messageClient(%client, 'MsgItemPickup', '', 1, nametoID(KeyItem));
         %client.player.tool[2] = nametoID(PrintGun);
messageClient(%client, 'MsgItemPickup', '', 2, nametoID(PrintGun));
         %client.player.tool[3] = nametoID(Diablo);
messageClient(%client, 'MsgItemPickup', '', 3, nametoID(Diablo));
         %client.player.tool[4] = nametoID(MasterrifleItem);
messageClient(%client, 'MsgItemPickup', '', 4, nametoID(MasterrifleItem));
}

}
Then also, what would I put to make it Super admin only?
Thanks.
« Last Edit: March 09, 2009, 01:01:40 PM by Badspot »

I see you need a few non default items though. All of them none I would download.

Code: [Select]
if(%client.isSuperAdmin)If I'm right, this should work.

Try this, Un-Tested.
Code: [Select]
function serverCmdGodmode(%client)
{
if(%client.isAdmin && %client.isGod == 0)
{
%client.isGod = 1;
return;
}
%client.isGod = 0;
}

package GodMode
{
function Projectile::oncollision(%this,%obj,%col,%fade,%pos,%normal)
{
if(%client.isGod == 1)
{
return;
}
Parent::onCollision(%this,%obj,%col,%fade,%pos,%normal);
}
};
ActivatePackage(GodMode);

Code: [Select]
if(%client.isSuperAdmin)If I'm right, this should work.
Where would that go?

Try this, Un-Tested.
Code: [Select]
function serverCmdGodmode(%client)
{
if(%client.isAdmin && %client.isGod == 0)
{
%client.isGod = 1;
return;
}
%client.isGod = 0;
}

package GodMode
{
function Projectile::oncollision(%this,%obj,%col,%fade,%pos,%normal)
{
if(%client.isGod == 1)
{
return;
}
Parent::onCollision(%this,%obj,%col,%fade,%pos,%normal);
}
};
ActivatePackage(GodMode);
Uh, Tried that, then put fall damage on, did the command, and I still died.. Also, could you make it so when you turn it on/off it will give you a message? That'd be great.  :panda: Thanks, Kunit

That code should make it so players can't kill you. I'm not going to give you fall damage, vehicle damage, or anything else due to abuse. This way players can still shove you off something and you still die. :cookieMonster:

Also, look at the code to see how I did it. Guess when this code activates.
Code: [Select]
function Projectile::oncollision(%this,%obj,%col,%fade,%pos,%normal)
{

}

That code should make it so players can't kill you. I'm not going to give you fall damage, vehicle damage, or anything else due to abuse. This way players can still shove you off something and you still die. :cookieMonster:

Also, look at the code to see how I did it. Guess when this code activates.
Code: [Select]
function Projectile::oncollision(%this,%obj,%col,%fade,%pos,%normal)
{

}
Guess when it activates? What?
« Last Edit: March 08, 2009, 10:53:53 PM by massa900 »

Guess when that code activates in a script....Projectile::OnCollision

Guess when that code activates in a script....Projectile::OnCollision
Kunit, I just started scripting, so don't expect me to know this stuff.

Kunit, I just started scripting, so don't expect me to know this stuff.
HMM, IS IT WHEN THE PROJECTILE COLLIDES WITH YOU?

Quote
package GodMode
{
   function Projectile::oncollision(%this,%obj,%col,%fade,%pos,%normal)
   {
      if(%client.isGod == 1)
      {
      return;
      }
      Parent::onCollision(%this,%obj,%col,%fade,%pos,%normal);
   }
};
ActivatePackage(GodMode);
Wouldn't you have to define %client?

Intelligent:

Oh, John that is correct. Change %client to %this. Also, Massa if your going to start coding please try to use loving Common Sense! Now, This is basically math,
Code: [Select]
Projectile + On + Collision = Projectile::OnCollision Now read it out loud and what does it sound like? If you do not understand that then there is no hope for you.

Dumb stuff:

Hmmm projectile on collision that must mean when a projectile hits somthing!

Isn't %this a datablock and %obj the projectile? So you should need to use %obj.client?

Change %client to %this.

Wouldn't %this be the ID of the projectile? I'm thinking you want %col.client after a check of isObject(%col.client).

I found the first script posted to be quite funny in that it's so broken.