Author Topic: Checking for minigame damage?  (Read 421 times)

I'm using the function "Projectile::Damage(%this,%obj,%col,%fade,%pos,%norm)", and I need to check if the player who fired the bullet and the player who got hit are in the same minigame. Once that comes back as true, I need to check if the minigame has damage enabled.

Help?

I've tried this,

Code: [Select]
%mini1 = getMiniGameFromObject(%this);
%mini2 = getMiniGameFromObject(%obj);

and complared the two variables. When not in a minigame, they match. When in a minigame, they no longer match.

Without the minigame check the function damages anything, regardless of minigame and/or enabled damage.


Code: [Select]
%mini1 = getMiniGameFromObject(%obj.sourceObject);
%mini2 = getMiniGameFromObject(%col);
if(isObject(%mini1) && %mini1 != %mini2)
//don't do damage
else
//do damage

Also, if you're trying to make some custom variables for minigame damage, package minigameCanDamage*. It's basically used for everything to do with damage in minigames (obviously) so that works better.

*minigameCanDamage handles a variety of classes so you'll need to do a switch and get the client from each type of object.

The posted code didn't work. I may have done something incorrectly.

However, it doesn't matter, as the problem was resolved. After further testing, I found out that there was no problem at all. :D

Silly me.

Locked.