Jump to content
Sign in to follow this  
WurschtBanane

Execute server command with script/trigger?

Recommended Posts

How do i execute a server command in a mission?

 

When you login as an admin with #login password and then type #mission MISSIONNAME a new mission starts.

I want to do that via a script or a trigger after the mission end screen appears. Why? because when people click ok instanly they get joined back into the mission because the server does not load the new one fast enough.

Share this post


Link to post
Share on other sites

"SideScore" call BIS_fnc_endMissionServer; sleep 15; serverCommand "#mission missionname"

 

It tells me: On activation: Type Bool, expects nothing.

 

What i basically want to do is start the new mission with this #mission command because on my server the old one keeps running up to 10 secs after it finished which means that people sometimes join back in and then it never ends.

Share this post


Link to post
Share on other sites
"SideScore" call BIS_fnc_endMissionServer; 
sleep 15; //won't work, code inside trigger cannot be suspended
_var2 = serverCommand "#mission missionname"; //returns true, return value needs to be stored somewhere

Use a second trigger with a coundown of 15 seconds and execute the serverCommand from there.

Share this post


Link to post
Share on other sites
"SideScore" call BIS_fnc_endMissionServer; 
sleep 15; //won't work, code inside trigger cannot be suspended
_var2 = serverCommand "#mission missionname"; //returns true, return value needs to be stored somewhere

Use a second trigger with a coundown of 15 seconds and execute the serverCommand from there.

 

How do i store the return value? And why? I am sorry im not that good at this.

Share this post


Link to post
Share on other sites

How do i store the return value? And why? I am sorry im not that good at this.

 

I've already changed that in the example. The bool returned by serverCommand is stored in the variable _var2.

Share this post


Link to post
Share on other sites

I've already changed that in the example. The bool returned by serverCommand is stored in the variable _var2

Well when the trigger is activated or if i put this line in a script, the server does not load the other mission. Same with mission restart.

Share this post


Link to post
Share on other sites

Well when the trigger is activated or if i put this line in a script, the server does not load the other mission. Same with mission restart.

I've never worked with serverCommand, so I don't know whether it can actually be excuted by a trigger.

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  

×