Author Topic: Getting a projectile's source item's user's client  (Read 2098 times)

Strange. I've tested that exact script alone (i.e. nothing else in the package) and with only default add-ons.


Code: [Select]
package testPackage2
{
function ProjectileData::damage(%this,%obj,%col,%fade,%pos,%normal)
{
messageClient(%obj.sourceClient,' ',"Bla Bla Bla Test");
Parent::damage(%this,%obj,%col,%fade,%pos,%normal);
}

};
activatePackage(testPackage2);
That's it.

add in error(%obj.sourceclient.name); and see if it echoes the client's name..

Quote from: Amade
I tested this and it works fine.
Didn't for me, but using %obj.sourceObject.client did.

sourceObject.client did work. Dunno what's up with that but thanks everyone.

Not really related but what are the variable's for a vehicle/player's current health? I'm fairly sure about the max health (it's pretty obvious) but I dunno about current health.

Not really related but what are the variable's for a vehicle/player's current health? I'm fairly sure about the max health (it's pretty obvious) but I dunno about current health.
%obj.getDatablock().maxDamage - %obj.getDamageLevel();
Pretty roundabout, I know, but there's not a function just for current health.