He-Man Posted April 28, 2016 Report Share Posted April 28, 2016 I noticed, that we have to use remoteexec very carefully! While many tests, I found out, that the following code is very dangerous: _owner = owner _vehicle; [_blabla,_blablabla] remoteexec ["xxx",_owner]; If _vehicle does not exists (because of a script failure or the vehicle no longer exists), the remoteexec will be executed on every client. Same for: [_blabla,_blablabla] remoteexec ["xxx",(owner _vehicle)]; Better use directly: [_blabla,_blablabla] remoteexec ["xxx",_vehicle]; If here the _vehicle does not exist, nothing will be executed. From https://community.bistudio.com/wiki/remoteExec: Object - the function will be executed only where unit is local So NEVER use the owner of anything for remoteexec!!! Some Epoch codes are also using the owner for remoteexecs. This should be changed... arc7r7 and ScaRR 2 Link to comment Share on other sites More sharing options...
vbawol Posted April 28, 2016 Report Share Posted April 28, 2016 It does make sense since owner would return 0 and 0 on remoteExec is "executed on each client including the one where remoteExec was called from" Good catch, will certainly keep this in mind going forward. Link to comment Share on other sites More sharing options...
Demellion Posted April 29, 2016 Report Share Posted April 29, 2016 Quote On server machine, returns the ID of the client where the object is local. Otherwise returns 0. For use on clients clientOwner command is available. To find out the owner of a Group, use groupOwner. If you want to use owner carefully, just check the object presense before with !isNull(object) as a condition. You also may check for some object parameters, since sometimes object may leave reference to it in server memory (known problem of Object not found. on server) with something like damage, getHit, or any global variable present on object. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now