Thanks to LoyalGuard for this:
Here is a list of machine types (singleplayer, servers, client) and how various condition checks will return if run on that machine. For example, if you wanted to make sure a machine was a MP host and not a dedicated server you could run:
if ((isServer) and (!isDedicated)) then {...);
You don’t usually need to check more than two (and sometimes one will do) but here is a list of how all three SP/MP condition checks return for all SP/MP game modes:
EDITOR PREVIEW / SINGLEPLAYER:
isMultiplayer returns false
isServer returns true
isDedicated returns false
MULTIPLAYER (NON-DEDICATED) HOST SERVER
isMultiplayer returns true
isServer returns true
isDedicated returns false
MULTIPLAYER DEDICATED SERVER
isMultiplayer returns true
isServer returns true
isDedicated returns true
MULTIPLAYER CLIENT
isMultiplayer returns true
isServer returns false
isDedicated returns false
#1 by K9 on August 17, 2010 - 5:30 PM
Where i put this?
#2 by kylania on August 17, 2010 - 6:50 PM
You’d put it around code that you would only want run once, by the server generally. They are tools to make sure that your code is not run by everyone for example.
If you have a trigger run a script it will run on everyone’s PC. If you use isServer to check which client it is, then it can be run just once.
#3 by K9 on August 17, 2010 - 7:18 PM
Can you make one example?Sorry for be soo noob…i´m make my steep in make OA mission.
#4 by kylania on August 18, 2010 - 2:47 AM
My reward hint demo has an example. If you look in the main script you’ll see that all the spawning code is wrapped in:
Making sure that the … stuff is only run once, by the server, rather the once per player connected.
#5 by K9 on August 18, 2010 - 5:27 PM
Thks for the info.
If youhave time make some videos for the beginers like me, and little demo with the use of the scrips