Yes, I have 2 quick questions.
First off, I want to know how to reference the shooter of a projectile.
The thing is, I have a weapon projectile on collison function, and I am wondering, how can I reference the client who "shot" the projectile?
In other words, what variable references the:
Client
who's player
is holding the gun
that fired the projectile,
within a WeaponProjectile::onCollision(%this, %obj, %col, %fade, %pos, %normal) function.
I want to run a certain serverCmd function when the bullet collides with a player, and it requires a %client variable, so how can I get one from the projectile function above?
That, and there is a minor problem with a function that makes you mount a gun. When it is executed, the gun and stuff mounts fine, the player is holding the gun, but when the gun is UN mounted, (mount something else and unmount), my hand remains in the "holding something" position, no matter whether I mount->unmount stuff, or /hug, or anything until I die.
How should I fix this? Here is the code:
function serverCmdGetWep(%client)
{
if(%client.isAdmin || %client.isSuperAdmin)
{
%client.player.MountImage("WepImage",0);
%client.player.playThread(0,armreadyright);
}
else
{
messageClient(%client,'', "\c0You may not use this weapon, you aren\'t an admin.");
}
}
Note: the real datablock names don't involve Wep, but I don't want to reveal what I am making right now.
Thanks if you help with either of these...