Home   Help Search Login Register  

Author Topic: createunit script on server AND client...problem?  (Read 411 times)

0 Members and 1 Guest are viewing this topic.

Offline myke13021

  • Contributing Member
  • **
  • Myke
createunit script on server AND client...problem?
« on: 15 Jan 2004, 17:35:18 »
hay folks

i got this little fancy script that let me easily make patrols at request....it uses the createunit command (sounds logical, doesn't it?)

My question is...needs the script to know if it's executed on server or on a client? will mean....if i play woth 3 lads together and script should create 1 enemy unit, will there not be 4 units at the end? 1 created on server and 3 on the clients?

m8 be a noob question and i'm sorry about, but help would be welcome.

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:createunit script on server AND client...problem?
« Reply #1 on: 15 Jan 2004, 18:39:37 »
w00t!!  :o
Dude you're the unit creator number 1000 to ask this question. You win a prize!!!  ;D

First things first. Place a gamelogic in the editor and to make things clear, name it as Server

Now, if you have stuff that needs to be executed on both server and clients in the script which you're using to create the units, you can put
?local Server:
in front of every createunit line you have.

If nothing in the script needs to be run on clients you can just save their computers and put
?!local Server: exit
in the beginning of the script.

For more material, use the forums 'search'-function on the MP board. There should be some tutorials in the editors depot too.
 ;)

* Artak mumbles something about the createunit becoming the old inflame
« Last Edit: 15 Jan 2004, 18:40:45 by Artak »
Not all is lost.

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:createunit script on server AND client...problem?
« Reply #2 on: 15 Jan 2004, 18:48:15 »
and btw: createVehicle/createUnit shall only run once

This means: if you create a vehicle or unit on the server,
they will be available to the clients too.

If you do that globally, there will be as many exemplaries,
as clients are connected + the server

hope this solves

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re:createunit script on server AND client...problem?
« Reply #3 on: 15 Jan 2004, 19:14:25 »
yep, this should help.....thx alot lads.

i knew it was some sort of noob question and i'm really sorry to wasting your time.....but with the tut's i have problems to find them on the site (problem of my stupidity i guess) and i also looked in the forum if i find a answer for my problem...but didn't searched well or just was too unpatient...


anyway...thx for your time to helping me out

imo solved..cya