Jump to content
sgtelis

player allowDamage true call on all machines help

Recommended Posts

So from what I've been able to figure out the code "player allowDamage true;" only gets done on the client that it's called on.

In my mission I'm making this turns out really strange.
In the begining everyone are unkillable (using allowDamage false) and then when the mission actually starts I want them to take damage.

However,

due to it not being called properly the players can kill themselves with grenades but not kill eachother.

Share this post


Link to post
Share on other sites

Depends how you're calling the code

Share this post


Link to post
Share on other sites

I call it through a script, more than that I don't know how to do.

Share this post


Link to post
Share on other sites

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

 

Note the "AL" icon, The thing you're executing it on has to be local, in your example you're using player, which is the current "player" object on each client. Player object is always local (for each client, on a dedicated it does not exist - objNull).

Note the "EG" icon, that means that it's broadcasted, so no, you would not have to execute it on every machine.

 

You should post the script and how it's called

  • Like 1

Share this post


Link to post
Share on other sites

What i ment is, please could you post the code here so i can tell are you calling it in the right way > global or local > on every machine or only server

Share this post


Link to post
Share on other sites

Well, it's presented right in the link you sent.

player allowDamage true;

called in a script I call from the init.sqf

This makes that player only able to kill him self and not other players.

Share this post


Link to post
Share on other sites

Ok, to clarify even more.

This is taken directly from that link too:

Multiplayer: This command only works locally and must be run on all machines to have global affect.

How do I run it on all machines?

Works locally since I can kill my self but for everyone else I still dont take damage.

Share this post


Link to post
Share on other sites

in initPlayerLocal.sqf

//executed by every player connected
[] spawn {

            waitUntil {sleep 1; !isNull player};// waiting for player spawn and become global for every others
            player allowDamage false;

};

Share this post


Link to post
Share on other sites

 

in initPlayerLocal.sqf

//executed by every player connected
[] spawn {

            waitUntil {sleep 1; !isNull player};// waiting for player spawn and become global for every others
            player allowDamage false;

};

well, yeah. I got that far. The problem is making them take damage again.

Share this post


Link to post
Share on other sites

Got it working, problem was (I think) that I changed it to false and then to true in different scripts. Not sure though, but it works now.

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

×