PlacidBox 10 Posted April 6, 2013 Hey, I'm doing some multiplayer scripting and am running in to strange behavior with "publicVariableServer." The problem is that with a non-dedicated server, the publicVariableEventHandler only gets called when the local player does publicVariableServer, not when any remote players do. init.sqf is esentially: playerDeath = objNull; if (isServer) then { on_player_death = { hint "player died"; }; "playerDeath" addPublicVariableEventHandler on_player_death; }; if (isDedicated) then {exit}; on_death = { playerDeath = playerSide; publicVariableServer "playerDeath"; }; sleep 0.01; // wait for mission to begin player addEventHandler ["killed", on_death]; Swapping the publicVariableServer for just a normal publicVariable works as expected (remote deaths cause the function to be called, local ones don't.) Is there something extra that I need to do to get these calls though, or is it just bugged? Share this post Link to post Share on other sites
Tankbuster 1747 Posted April 6, 2013 then {exit} is sqs. Are you sure it works in SQF? Share this post Link to post Share on other sites
PlacidBox 10 Posted April 6, 2013 You're right, it's a mistake, i'd swapped it from if (!isDedicated) then { // client code here }; but it doesn't matter, anyway, since this isn't being run on a dedicated server at any point. Share this post Link to post Share on other sites
killzone_kid 1333 Posted April 8, 2013 hint is local should do nothing on dedicated server and would probably work on client if client is server Share this post Link to post Share on other sites