Author Topic: Questions  (Read 4782 times)

What about making a player tumble?
Hmm, wasn't there a tumble event?
Could be a usefull add-on for script resource. =D

Hmm, wasn't there a tumble event?
Could be a usefull add-on for script resource. =D
I thought making tumbling easy was removed do to 'abuse'
You used to be able to do
Code: [Select]
tumble(%col, 7000);I don't think you still can.

I thought making tumbling easy was removed do to 'abuse'
You used to be able to do
Code: [Select]
tumble(%col, 7000);I don't think you still can.
Try this:
Code: [Select]
tumble(%this,%int);I found it in the event, not sure if you can use it though.

Dang, just found out, the event doesn't work :/

Try this:
Code: [Select]
tumble(%this,%int);I found it in the event, not sure if you can use it though.

Dang, just found out, the event doesn't work :/
Tumble works. What about checking if the player is mounted by another player?

Tumble works. What about checking if the player is mounted by another player?
Yeah, i just found a nice piece of code in skis item.

Mounted by another player, now that is interesting. :P
Code: [Select]
function Whatever::onMount(%a,%player,%vehicle,%d,%e,%f, or w/e you have in mind)
{
parent::onMount(%a,%player,%vehicle,%d,%e,%f);
if(%this.dataBlock.getName() !$= "PlayerStandardArmor" && %col.dataBlock.getName() $= "PlayerStandardArmor")
{
//dostuffhere
}
}

Yeah, i just found a nice piece of code in skis item.

Mounted by another player, now that is interesting. :P
Code: [Select]
function Whatever::onMount(%a,%player,%vehicle,%d,%e,%f, or w/e you have in mind)
{
parent::onMount(%a,%player,%vehicle,%d,%e,%f);
if(%this.dataBlock.getName() !$= "PlayerStandardArmor" && %col.dataBlock.getName() $= "PlayerStandardArmor")
{
//dostuffhere
}
}
What? You have no clue what you are doing...

Code: [Select]
//called when the driver of a player-vehicle is unmounted
function HorseArmor::onDriverLeave(%obj, %player)
{
%obj.Mounted = 0;
}
function armor::onMount(%this,%obj,%col,%slot)
{
      Parent::onMount(%this,%obj,%col,%slot);
      if(%col.getDataBlock() == HorseArmor.getId())
{
%col.Mounted = 1;
}
}





function armor::onCollision(%this, %obj, %col, %fade, %pos, %normal)
{
parent::onCollision(%this, %obj, %col, %fade, %pos, %normal);
if(%obj.dataBlock.getName() $= "HorseArmor" && %obj.getState() !$= "Dead")
{
if(%this.Mounted = 1)
{

if(%col.getType() & $Typemasks::PlayerObjectType)
{
if(%col.getState() $= "Dead")
{
return;
}
else
{
tumble(%col, 7000);
}
}
}
}
}
Spams with Unknown command Oncollision and Unknown command Onmount

What? You have no clue what you are doing...
I suggested something.. :/
Will shut up if you want.

Hello? You're overwriting a function, package it.

Hello? You're overwriting a function, package it.
What will packaging it do?

What will packaging it do?

Packaging is the process of editing existing functions without overwriting them.
Say you have this function:

Code: [Select]
function docrap()
{
   echo("Hello");
}
Quote
==> docrap();
Hello

You can change what it does in a package like so:

Code: [Select]
function docrap()
{
   echo("Hello");
}

package overwritecrap
{
   function docrap()
   {
      echo("World!");
   }
};
activatePackage(overwritecrap);
Quote
==> docrap();
World!

Want to have it also perform what it should do normally?

Code: [Select]
function docrap()
{
   echo("Hello");
}

package overwritecrap
{
   function docrap()
   {
      Parent::docrap();
      echo("World!");
   }
};
activatePackage(overwritecrap);
Quote
==> docrap();
Hello
World!

i have a problem  :panda: i can't download or install the addons

Code: [Select]
package overwritecrap2
{

function HorseArmor::onAdd(%this,%obj)
{
   // Vehicle timeout
   %obj.mountVehicle = true;

   // Default dynamic armor stats
   %obj.setRepairRate(0);

}

//called when the driver of a player-vehicle is unmounted
function HorseArmor::onDriverLeave(%obj, %player)
{
%obj.Mounted = 0;
}
function armor::onMount(%this,%obj,%col,%slot)
{
      Parent::onMount(%this,%obj,%col,%slot);
      if(%col.getDataBlock() == HorseArmor.getId())
{
%col.Mounted = 1;
}
}





function armor::onCollision(%this, %obj, %col, %fade, %pos, %normal)
{
parent::onCollision(%this, %obj, %col, %fade, %pos, %normal);
if(%obj.dataBlock.getName() $= "HorseArmor" && %obj.getState() !$= "Dead")
{
if(%this.Mounted = 1)
{

if(%col.getType() & $Typemasks::PlayerObjectType)
{
if(%col.getState() $= "Dead")
{
return;
}
else
{
tumble(%col, 7000);
}
}
}
}
}
};
activatePackage(overwritecrap2);
It isn't checking if the player is mounted. I want it so if the horse has no driver, it won't tumble people. Once the horse has a driver, it can tumble people it rams in to.

Syntax errors:

Code: [Select]
function CarbineHALOImage::checkammo(%this,%obj,%slot)
{
    if(%obj.ammo["carbine"]$="")
    %obj.ammo["carbine"]=$ammo::default["carbine"];
    if(%obj.ammo["carbine"])
    %obj.setimageammo(%slot,1);
    centerPrint(%obj.client, "<just:right>"@%obj.ammo["carbine"]@"/18 Packages: "@%obj.ammount["carbine"]@");
}

In the center print you're re-opening the string. Just remove @" at the end.