[bfprog] Implementing a slap-function

"Einar S. Idsø" esi at itk.ntnu.no
Fri Jul 29 08:03:15 PDT 2005


Does anyone know how to programmatically make a player exit a vehicle
and become a foot-soldier?

Why I'm asking:
We are working on an ingame-admin script with quite similar
functionality to Kevin Lockitt's BFxM-series in which you could issue
commands such as !kick <partofplayername> in the ingame-chat (sidenote:
that function was a result of our community's ideas and my close
communication with Kevin as beta-tester :)). As a part of the
command-repertoire we'd like a slap-type command to get a player's
attention when they don't listen to !warn-messages.

One of the ways of making a slap is to set the player coordinates five
hundred meters above their current location - now that should get their
attention, all right! This is quite easy to do, but there are some problems:

1. When slapping the passenger of a vehicle, nothing happens until the
passenger exits the vehicle, at which point the slap takes effect.

2. When slapping a soldier who is using a firmly placed weapon such as
TOW or AA, the entire object is transposed 500 meters up, not just the
player. It doesn't fall back down like a tank would, probably because it
has no mass-properties.

3. Weapons fired from a Cobra after the co-pilot had been slapped, were
fired 500 meters above the heli.

All of these instances can be explained with the fact that it's the
player's vehicle-object that is being lifted the 500 meters. When the
player is not a foot-soldier this means that his vehicle is his
AA-weapon, his gun on the chopper etc. It is of course possible to run
the slap only when the vehicle is of type footsoldier, but that really
limits its use.

All of these problems would have been avoided if we had a way of forcing
a player to exit his vehicle immediately before he is slapped. I can't
find any methods to do this, unfortunately - anyone else?

Other clever suggestions to how we can make this function or a similar
one are also appreciated. Making a kill-function would inherit many of
the problems from the slap-function, so this is a problem that would be
nice to solve for more reasons than one :)

Cheers,
Einar, Kybber @ Battlefield.no


More information about the BFProg mailing list