Home   Help Search Login Register  

Author Topic: createvehicle multi player  (Read 1697 times)

0 Members and 2 Guests are viewing this topic.

Offline sharkattack

  • Former Staff
  • ****
createvehicle multi player
« on: 11 Mar 2007, 12:19:17 »
me again ..  :-[
ive made a map in which a village is created ..
i use the code in my init sqs

Code: [Select]
hut1="Land_hut04" createvehicle (getmarkerpos"a");hut1 SetDir 480;
hut2="Land_hut04" createvehicle (getmarkerpos"b");hut2 SetDir 480;
hut3="Land_hut04" createvehicle (getmarkerpos"c");hut3 SetDir 480;
hut4="Land_hut04" createvehicle (getmarkerpos"f");hut4 SetDir 480;
hut5="Land_hut02" createvehicle (getmarkerpos"g");hut5 SetDir 190;
hut6="Land_hut02" createvehicle (getmarkerpos"h");hut6 SetDir 190;
hut7="Land_hut02" createvehicle (getmarkerpos"i");hut7 SetDir 190;
hut8="Land_hut02" createvehicle (getmarkerpos"j");hut8 SetDir 190;
fl1="Land_fuelstation_army" createvehicle (getmarkerpos"k");fl1 SetDir 325;
bighut1="Land_hut_old02" createvehicle (getmarkerpos"d");bighut1 SetDir 180;
bighut2="Land_hut_old02" createvehicle (getmarkerpos"e");bighut2 SetDir 180;
genny="Land_Vysilac_FM" createvehicle (getmarkerpos"l");genny SetDir 130;
barr1="Land_bouda2_vnitrek" createvehicle (getmarkerpos"br1");barr1 SetDir 330;
barr2="Land_bouda2_vnitrek" createvehicle (getmarkerpos"br2");barr2 SetDir 330;
barr3="Land_bouda2_vnitrek" createvehicle (getmarkerpos"br3");barr3 SetDir 330;
barr4="Land_bouda2_vnitrek" createvehicle (getmarkerpos"br4");barr4 SetDir 330;
chal="Land_sara_stodola2" createvehicle [13877.34,16782.57,0.27];chal SetDir 330;
ht1="Land_hut_old02" createvehicle [13976.03,16729.88,1.87];ht1 setdir 70
brn="Land_sara_stodola" createvehicle [13932.94,16627.93,0.61];brn SetDir 180;

my trouble is everytime a player connects the init sqs creates the village ..
how can i create this only one time..



"HOLY SARDINE" - see Shark-Attack meet his match

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re: createvehicle multi player
« Reply #1 on: 11 Mar 2007, 12:55:34 »
The problem is, createvehicle is a local command and the init.sqs is executed on each connected client as on the server.

Take the corresponding code out of the init.sqs and put it in a separate script, call it "myvillage.sqs". At the top of the script put in this line:

Code: [Select]
?! (local server):exit

Place a gamelogic somwhere on your map and name it "server".

Now in the init.sqs just call the script with:

Code: [Select]
[] exec "myvillage.sqs"

With this it should work without any problems

Offline sharkattack

  • Former Staff
  • ****
Re: createvehicle multi player
« Reply #2 on: 13 Mar 2007, 18:26:01 »
thanks myke    problem solved      :good:
"HOLY SARDINE" - see Shark-Attack meet his match