Jump to content
Sign in to follow this  
thryckz

Get player who runs script

Recommended Posts

I am trying to avoid putting all of the units in arrays and having the arrays activate. Surely there is a way to have the script execute on the player who is running it. I just don't remember it if I have ever known.

An text suedo code would be like:

// unit named "x45" runs execVM "blah.sqf";
// blah.sqf retrieves player who activated script
// script inside blah.sqf is ran on unit x45, independent of the other players.

Share this post


Link to post
Share on other sites

Your description of the problem doesn't really explain what you want to accomplish and how?

A few things that might help you:

//pubvarclient as already noted earlier, to be ran from the server
myvariable = "some fancy stuff to execute or send to a client";
(owner playerobject) publicvariableclient "myvariable";

//////////////////////////////////////////////////
// Execute only if the player is local on the machine running the script
if (local player) then {};

//////////////////////////////////////////////////
//Retrieve player object to be used later on?
_playerobject = format ["%1",player];

//////////////////////////////////////////////////
//check if player is the desired "model" that the script should be executed on
if (player == desiredmodel) then {};

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
Sign in to follow this  

×