WurschtBanane 11 Posted November 5, 2016 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
MrCopyright 107 Posted November 5, 2016 You can use serverCommand to execute commands such as #mission, #kick, #ban and so forth. If you want to include dynamic mission names, use the format command as well. 1 Share this post Link to post Share on other sites
WurschtBanane 11 Posted November 5, 2016 Thanks, ill try that. Share this post Link to post Share on other sites
WurschtBanane 11 Posted November 5, 2016 "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
R3vo 2654 Posted November 5, 2016 "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
WurschtBanane 11 Posted November 5, 2016 "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
R3vo 2654 Posted November 6, 2016 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
WurschtBanane 11 Posted November 6, 2016 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
R3vo 2654 Posted November 6, 2016 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