Home   Help Search Login Register  

Author Topic: Server side only scripts?  (Read 1209 times)

0 Members and 1 Guest are viewing this topic.

Offline Ducatisto

  • Members
  • *
  • I'm a noob at this!
Server side only scripts?
« on: 24 Mar 2004, 08:46:22 »
I am interested in a script but in its instructions even though it says it is MP compatible it should only be run from the server? Please could someone educate on old fool, I am new to the editing side of things and I want to make as good an example as I can regarding an MP mission I am currently creating.  :-\

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Server side only scripts?
« Reply #1 on: 24 Mar 2004, 16:38:42 »

to make sure a line or a command is run only by the server

1) Create a game logic, and in it's "name Box", type
Server

then use the following line at the very top of the script
? !(local server):exit
which translates as
"If this machine is not the server, then exit"

or if starting the script from the Init.sqs
? (local server):[] exec "myscript.sqs"
(If this machine is the server, then run "myscript.sqs")


reason being, that gamelogics are only seen as local to the server machine, therefore, a gamelogic named server can only be local to the server machine

any name would do, however, normal protocol is to name the gamelogic "server"

other options are to use the query in a script line
eg

;;myscript.sqs
line 1 do this
line 2 do this
?(local server): myvariable = myvariable + 1; Publicvariable "Myvariable"

line 3 will be run by the server only


the statement "local", basically means is the object i am referring too, local on this machine.

Things that arent local on a server are normally only Players


Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline Zombie

  • Members
  • *
  • Beware the night, the zombie walks among you
    • USI
Re:Server side only scripts?
« Reply #2 on: 24 Mar 2004, 16:40:47 »
1.  Put a game logic on the map named server
2. In your script you only want run on the server side, put the line:
?!(local server): exit


Honestly I don't completely understand what this does, but I know it solves a multitude of problems, especially with vehicle respawning.

Offline Ducatisto

  • Members
  • *
  • I'm a noob at this!
Re:Server side only scripts?
« Reply #3 on: 24 Mar 2004, 16:50:22 »
Many thanks.  :)

Slowly, very slowly my understanding of scripting is increasing.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Server side only scripts?
« Reply #4 on: 25 Mar 2004, 01:26:01 »
Vehicle respawns and controling the scoring system need to be run by the server only

If they arent, you get multiple instances of the same vehicle being created or multiple verions of the scoring system and other oddities
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123