Jump to content
Sign in to follow this  
lucilk

Execute script on a client

Recommended Posts

I am trying to figure out how can i make a script execute on all computers or only on server, i read all the FAQ and still learning but the bottom line is simple:

I have a nuclear bomb, its ACE2 nuclear bomb, and if me (the server) or someone else (a client) detonate it or launch the script it only works on his computer, if i activate it, it only works for me, so how do you synchronise everything, the damage the effects, and generaly speaking how to execute scripts globaly?

Edited by lucilk

Share this post


Link to post
Share on other sites

Multiple ways, but one simple, non scripting, way is to use double triggers:

TRIGGER 1

condition: your condition here, can be whatever

onAct: nukeBoom = true; publicvariable "nukeBoom"

TRIGGER 2

condition: nukeBoom

onAct: nul = [] execvm "nuke.sqf"

If you are using addaction, then you can skip the first trigger.

player addaction ["boom","ohnoes.sqf"]

OHNOES.SQF

nukeBoom = true; publicvariable "nukeBoom"

The basic idea here is to have a trigger that will execute the script waiting for a variable which will be synced with publicvariable to all players. It doesn't matter from where you set and PV it.

Share this post


Link to post
Share on other sites

shk i dont like triggers and the script pack is waaaaaay to complex for triggers.

Now is ---------[nil,nil,nul=[] execvm "script.sqf"] call RE------- will execute the script.sqf on all clients?

Can someone confirm, if this is the solution i can easily implement this and execute a script on all clients.

Please help me out guys.

Share this post


Link to post
Share on other sites

This should be correct:

[nil, nil, rEXECVM, "script.sqf", param0, param1, param2_and_so_on];

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  

×