Home   Help Search Login Register  

Author Topic: Radio Trigger and format publicVariable problem  (Read 1976 times)

0 Members and 1 Guest are viewing this topic.

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Radio Trigger and format publicVariable problem
« on: 03 Apr 2009, 20:37:08 »
I want the players to be able to wait X hours (skiptime) whenever they want.
With Radio Bravo you add 1 hour to a variable called "waitadd", this you can do any number of times wanted.
With Radio Charlie you then activate the waiting function and skip the X number of hours, chosen with Radio Bravo.

Radio Bravo
Condition: this
OnAct; if (isServer) then {waitadd = waitadd + 1; publicVariable "waitadd"; waitinfo = hint format ["%1 Waiting hour(s) chosen", waitadd]; publicVariable "waitinfo"}

Radio Charlie
Con: this
OnAct: titletext [format ["Waiting %1 hour(s)...", waitadd], "BLACK IN", 5]; skiptime waitadd

Problem:
On a dedi the format doesn't work, you dont see the hint but when you do Radio Charlie it says "Waiting X hours" and the correct number of hours hours are skipped.

Question:
I could just skip the if isServer thing, but how do I then avoid that the "waitadd" gets multipled by the number of players every time?

 :dunno:
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline schuler

  • Contributing Member
  • **
Re: Radio Trigger and format publicVariable problem
« Reply #1 on: 04 Apr 2009, 00:13:19 »
iam not very good at this but this might help you set up some of it

Code: [Select]
; Activated By: Vehicle Present
;Condition: this
;On Activation: WaitAction = Player addaction ["Wait 10 hours", "skiptime.sqf"];
;On DeActivation: Player removeAction WaitAction; WaitAction = nil;

titleText ["You take a rest for a couple of hours, until night falls...", "plain down"];
cutText ["", "black out", 1];
sleep 2;
skipTime 10;
sleep 1;
cutText ["", "black in", 1];
but its set to 10 hours
Semper Fi

Offline i0n0s

  • Former Staff
  • ****
Re: Radio Trigger and format publicVariable problem
« Reply #2 on: 04 Apr 2009, 01:09:49 »
Code: [Select]
waitadd = waitadd + 1; publicVariable "waitadd"; waitinfo = hint format ["%1 Waiting hour(s) chosen", waitadd]; publicVariable "waitinfo"runs completely on the server. So the client can't see it.
Easiest solution: Add an publicVariableEventhandler to waitinfo and display the hint there.

Offline schuler

  • Contributing Member
  • **
Re: Radio Trigger and format publicVariable problem
« Reply #3 on: 04 Apr 2009, 01:13:51 »
hey sorry Laggy i was way off track with server!
Semper Fi

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Re: Radio Trigger and format publicVariable problem
« Reply #4 on: 04 Apr 2009, 01:42:02 »
Much obliged  :D
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.