Jump to content
Official BF Editor Forums
Sign in to follow this  
bunnyhop

Couple Variable/function Questions

Recommended Posts

Advice or links to answers to any of these questions would be much appreciated. I haven't had any luck location these items via the forum search

1) What is the proper command to issue a message/announcement to a single player?

2) While I know how to determine if said player is a squad leader, is there a function that can be used to obtain the ID of the squad leader for a player's squad?

3) What is the function to obtain the position of a player if the ID of said player is given?

Share this post


Link to post
Share on other sites

Sorry, i can only answer question 3 . Learned that from kiff's great antibotcamp code:

pos = p.getDefaultVehicle().getPosition()

Gets the position of a player (his body, not his vehicle) and puts it into 'pos'

p is the soldier properties array, retrieved through

bf2.playerManager.getPlayers()

Find more info in this helpful script :

http://bfeditor.org/forums/index.php?showt...=7410&st=30

Share this post


Link to post
Share on other sites
' date='Sep 27 2006, 04:03 AM' post='51366']

Sorry, i can only answer question 3 . Learned that from kiff's great antibotcamp code:

pos = p.getDefaultVehicle().getPosition()

Gets the position of a player (his body, not his vehicle) and puts it into 'pos'

p is the soldier properties array, retrieved through

bf2.playerManager.getPlayers()

great thank you =)

Share this post


Link to post
Share on other sites

Answer to #1: This was supposed to have been included in the 1.3 patch, this addition was to open the send text message channel ID 14. This way the server/players could send private messages to other players. This ability is non-functional at this time. You can not send private messages.

Answer to #2: You can find the ID for a player's squad leader. First return the ID of the squad for the player getSquadId() , off the top of my head, I believe that squad ID 0 means that a player is not in a squad, squad ID of 1 or greater means that the player is in a squad. Then just iterate through all players of a desired team, use the fucntion .isSquadLeader. Using this data you can find all the squad leaders for a team, and compare their squad ID to the player you are comparing it with.

Share this post


Link to post
Share on other sites
Answer to #1: This was supposed to have been included in the 1.3 patch, this addition was to open the send text message channel ID 14. This way the server/players could send private messages to other players. This ability is non-functional at this time. You can not send private messages.

Answer to #2: You can find the ID for a player's squad leader. First return the ID of the squad for the player getSquadId() , off the top of my head, I believe that squad ID 0 means that a player is not in a squad, squad ID of 1 or greater means that the player is in a squad. Then just iterate through all players of a desired team, use the fucntion .isSquadLeader. Using this data you can find all the squad leaders for a team, and compare their squad ID to the player you are comparing it with.

What about an alternative like an announcement to a player. Similar to say when a player runs out of combat area there's a yellow announcement stating such only viewable by said player. Is there a way to pythonize something of that nature?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×