Jump to content
DilllPickle

Setting variable on client from another client.

Recommended Posts

Just a quick example of what I want to do.

 

Set a variable on an object example a car.

 

Car1 setVariable["PlayerSetName", player, true];

player setVariable["ThisIsACar", true, true];

 

Then once those are set, I want a different player/client to call another script that does this.

 

_Test1 = Car1 getVariable["PlayerSetName",0];

_Test1 setVariable["ThisIsACar", false, false];

 

The code only works for the client that called the script and has his own name set in the variable. If a different player calls the script it will not set for the other player, even though the other player does see the variable correctly. I've tried bis_fnc_mp, remoteExec, and setting a global variable, the other client sees all the variables but just can't set it for the other player.

 

 

Share this post


Link to post
Share on other sites

You should not change variable data types.

 

I do not knew for sure what you want to achieve with this but:

 

car1 setVariable ["PlayerSetName", player, true];
player setVariable["ThisIsACar", true, true];

_earlier_player = car1 getVariable ["PlayerSetName", objNull];
if (!isNull _earlier_player) then {
_earlier_player  setVariable ["ThisIsACar", false, true];
};

 

 

 

Share this post


Link to post
Share on other sites

I realized I messed something up in the code, I fixed it, but thanks for the reply.

 

EDIT: I realized I was putting false, false, instead of false, true so it wasn't global.

Share this post


Link to post
Share on other sites

What do you intend to do with that?

Usually owner or groupOwner command does the trick.

Share this post


Link to post
Share on other sites
51 minutes ago, pierremgi said:

What do you intend to do with that?

Usually owner or groupOwner command does the trick.

Just messing around with some scripts for Exile, working on a hacking script, yea I know its probably bad to use those but I'm just messing around figuring out some stuff.

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

×