Jump to content

Generalmonimo

Member
  • Content Count

    3
  • Joined

  • Last visited

  • Medals

Community Reputation

0 Neutral

About Generalmonimo

  • Rank
    Rookie
  1. Generalmonimo

    Troubles with publicVariable..

    Thanks guys, that indeed was the problem.
  2. Generalmonimo

    Troubles with publicVariable..

    To clarify: I want to send data from the server to all clients (including me). This data for now is a counter but in my actual script it will be an updated scoreboard. All calculations (in this case incrementing the counter) will be done on the server (thus initServer.sqf) in the 'main'-loop. To send the data to the client i use publicVariable and i was expecting the event handler for the client (local Player, which while i'm hosting is also me) to fire and show the hint. The isServer condition in my case should be irrelevant because for initServer.sqf it is always true and for initPlayerLocal.sqf always false.
  3. Public variables are giving me headaches. I tried for hours to make them work in my scripts. Now i wrote a simple test mission to demonstrate what i'm doing and hope someone can point me to what i'm missing here. Hosting this with editor in MP mode. initServer.sqf: systemChat "Init Server"; Counter= 0; publicVariable "Counter"; while {true} do { sleep 10; systemChat "Update"; Counter= Counter + 1; publicVariable "Counter"; }; initPlayerLocal.sqf: systemChat "Init Player"; "Counter" addPublicVariableEventHandler { hint (str Counter); }; I expected to see a hint with a number increasing its value every 10 seconds. This didn't happen. Output from systemChat as expected: InitServer InitPlayer Update Update Update ...
×