Jump to content
Sign in to follow this  
kerozen

Help with some code

Recommended Posts

I did a CQB map for single player where you can reset blown up walls and hide/show killhouses. I  never tested it on a server but a friend did and says it doesn't work.

 

Me being a complete idiot when it comes to MP scripting i have no idea how to make it work online.

 

All the codes are pretty much the same it just changes the variable names. What could i do to make it work on a dedicated server?

 

initPlayerLocal.sqf

////////////////////////////BRAVO///////////////////////////////////////////
cqbbdoor = {
	cqb_b_d1 setdamage 0;
	cqb_b_d2 setdamage 0;
	cqb_b_d3 setdamage 0; 
	cqb_b_d4 setdamage 0;
	cqb_b_d5 setdamage 0;
};

//Resets
sign_cqb_b addAction ["Reset Portas", cqbbdoor];

//Hide & Show
hidecqbbravo ={
	sign_cqb_b hideObject true;
};

showcqbbravo ={
	sign_cqb_b hideObject false;
};

laptop1 addAction ["<t color='#00c72f'>Remover  Complexo Bravo</t>", hidecqbbravo];
laptop1 addAction ["<t color='#00c72f'>Construir Complexo Bravo</t>", showcqbbravo];

 

Share this post


Link to post
Share on other sites

The addactions will only show up to the person that executes this script, so either put this script in initPlayerLocal.sqf (or just init.sqf) (this will give literally everyone on server access) or remote execute it.

Share this post


Link to post
Share on other sites
40 minutes ago, stanhope said:

The addactions will only show up to the person that executes this script, so either put this script in initPlayerLocal.sqf (or just init.sqf) (this will give literally everyone on server access) or remote execute it.

 

All the code i posted is in the initPlayerLocal.sqf file. It works in singleplayer and the local host server but it seems it doesn't work on dedicated servers

Share this post


Link to post
Share on other sites

Ah, replace hideObject with hideObjectGlobal and remote exec it to the server 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×