Author Topic: What is the function for firing?  (Read 1342 times)

What's the function that will make a gun go BANG?

Could've just stuck this in the other topic :P

I believe it's weaponImage::onFire

It no work... maybe I'm looking for the wrong thing.

What would I type in to the console if I'm holding a gun and I wanna fire without clicking?

OMG NINJA EDIT: Yes, I remembered semi colonz.


mousefire();

Lol.

It would actually be something along the lines of weaponImage::onFire(weaponimage,firingplayer,sourceslot) and all that crap. I can't remember the parameters off the top of my head.



He doesn't realize it'll only work for himself.

If you're trying to force other people to fire weapons, %player.setImageTrigger(%slot,%on) might work.

If not, try this: (Untested and not advised if you are doing this all the time)
Code: [Select]
%n=new AIConnection();
%n.setControlObject(%client.player);
%n.setTrigger(0,1);
%n.setTrigger(0,0);
%client.setControlObject(%client.player);
%n.delete();

You could try:
Object.setimagetrigger(0,1);
Where, 0 is the mountpoint righthand, and 1 is on.
(not sure which kinds of objects support it, AIPlayer, Player, WheeledVehicle, and StaticShape I know that they support it.)
or:
WeaponImage::onFire(%this,%obj,%slot);
Where, %this is the image name (ex. SwordImage), %obj is the player, and %slot is the mountpoint.
Ex. WeaponImage::onFire(GunImage,%obj,0);

Sorry, my internetz failed for a while. What I tried to post would have been something like this:

Yes, I know mousefire only works for myself, I wasn't trying to control peoples. So you are all wrong, 'cept Peaceful War.