Jump to content
Newsparta

Dedicated server scripting, identifying players

Recommended Posts

I am having difficulty with a seemingly very specific problem. I am making a mission that is intended for a dedicated server. This mission adds a variety of actions that are added to all clients upon loading the game. My problem is this.

 

The user action being activated triggers the creation of a vehicle. considering the value for "player" is null on a dedicated server, I need to figure out what entity (which player) activated the addAction (seeing as any player in the mission can activate it at any time), and I am having a lot of difficulty trying to figure out how to spawn an object at their location if I have no idea which one has activated the action.

 

(btw. how do people paste in their notepad + + code too look so nice on the forums? Like for showing someone example code. I don't know how to do that.)

 

 

Share this post


Link to post
Share on other sites

Look at this page: 

https://community.bistudio.com/wiki/addAction

 

You have access to who called the action, the object the action is attached to and the ID of the action. You'll want to use the caller to find out which player executed the action.

 

 

Side note: As far as pasting code, copy it from your text editor, go to the forums here, you should be able to see an icon that looks like this: < >, but the arrows are blue, click that, paste in, click ok, done is done.

Share this post


Link to post
Share on other sites

Thanks, I must have completely skimmed over that part of it. I'll mess around with it.

 

Update:

 

Legit added 1 line of script and totally works like I want it.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×