Author Topic: 2 questions: refrencing a "shooter" and getting my hand in the right place again  (Read 1772 times)

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:
Code: [Select]
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...

Code: [Select]
messageAll("",%obj.client.name @ " haxx0red " @ %col.client.name @ "!!!");
Quote
Murderer haxx0red innocent_person!!!
« Last Edit: September 18, 2007, 06:51:23 PM by IbanX »

so %obj.client refers to the client who shot the projectile? Good, that's what I thought it was.

Problem 1 fixed.

But what about the hand getting stuck problem?
I don't want to Self Delete every time I get finished using a weapon via slash command...
Hao2FixWithCode?

hmmm,
Code: [Select]
  %client.player.playThread(0,armreadyright);remove it and try again, i made a script that does pretty much the same thing, but its a press this button and this item appers in ye hands :P....

You have to play the root animation.

%client.player.playthread(0,root);