Home   Help Search Login Register  

Author Topic: my speedcam script  (Read 1591 times)

0 Members and 2 Guests are viewing this topic.

Offline FiLL2d

  • Members
  • *
  • X.x
my speedcam script
« on: 22 Jul 2006, 23:24:09 »
i'm working on a speed camera script to go with my addon but I need help with something.

im using the 'speed = distance / time' formula in my script, and im using

#loop
time = time + 0.25
~0.25
goto "loop" needs to know when to stop


as a time script to get the time count between a distance. I was going to put two triggers that turn a variable on and off so i am able to switch the time count on and off via a simple boolean check of the trigger within the time count script.

The problem is, multiple players are going to be driving through the trigger, which means if its boolean status is true before its reset back to false again (by the time count ending) then the time count will not work for the second vehicle passing through the trigger.

i know i could do multiple triggers for each player but i'd rather take the effecient approach as triggers = lag

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: my speedcam script
« Reply #1 on: 24 Jul 2006, 00:58:50 »
fill,
need a few more specifics to help you with this. it is not completely clear to me what your trying to do.
urp!

Offline FiLL2d

  • Members
  • *
  • X.x
Re: my speedcam script
« Reply #2 on: 24 Jul 2006, 03:25:58 »
hm, i think a better question would be, is it possible to define a variable true locally and have the server and other players still see the variable as false.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: my speedcam script
« Reply #3 on: 24 Jul 2006, 19:37:35 »
Yes you can.  In fact, any global variable is local to the client only, unless a publicVariable command is used to synch it, or a trigger with appropriate conditions synchs it. A variable with the same name can have different values on each client, unless you make an explicit attempt to keep them in synch.

Let's say you place a trigger on your map with the condition field
Code: [Select]
this and ({local _x} count thisList) > 0  This trigger will only fire on the machine of the player who is in it. It effectively behaves as an independant trigger for each player.

« Last Edit: 24 Jul 2006, 19:40:41 by Mr.Peanut »
urp!

Offline FiLL2d

  • Members
  • *
  • X.x
Re: my speedcam script
« Reply #4 on: 24 Jul 2006, 22:24:45 »
aha! perfect, thank you.