Help with a dialog

gooses89

New Member
I have been working on a custom Dialog that will pop up when people join the server.

I have a button that I want people to have to press to be able to close it.

As it stands you can just hit Escape to close the dialog, is there anyway to get rid of that, so people HAVE to hit the button to close it?

Thanks
 
AddOns\dayz_code\init\compiles.sqf

dayz_spaceInterrupt = {...

Add smth like:

Code:
_myDisplay = findDisplay <your_display_idd>
if (_dikCode == 0x01 && (!isNull _myDisplay)) then {
    _handled = true;
};
 
gooses I'm interested in this as well. Care to share your code and we can figure it out together?
 
Sure, if it worked I was planning on sharing it after it was finished anyway. https://www.dropbox.com/s/jdx0ve0jotpla7p/servernews.rar

That's all the code I am using except the pictures aren't included.
then I just have
Code:
if (!isDedicated) then {
    [] execVM "compile\Server_News.sqf";

In my init.sqf

When a player joins the server it opens up after 5 seconds of being in game. Looks like this in game http://puu.sh/7LZ6w.jpg

I want players to have to press the button. The whole idea is that they read any new updates to the server, new add ons, new rules so people are informed and also so that they can't plead ignorance to anything new going on.

PS, ignore the stolen image in the bottom right corner :D
 
Last edited:
if you want this server sided and displayed clientside you'll have to learn about
by experience i can say dialogs are a pain in the backside!

- dialogs
- eventhandlers client/server
- owner id (server needs to know where to send data back)

dialogs can be closed by hitting esc
What you want to do is far from beginner stuff, but you dont have to take my word for it.

Also this my help you out alot since its basically what you are trying to do.
Seems like someone else with more experience beat you to it.
http://opendayz.net/threads/help-dialog.19407/
 
I noticed this post so thought i would modify the help dialog.
I have it half done but have to go to work and though I would give everyone a heads up.
The idea is to have a 'Terms of Service" dialog that displays ONLY the first time a player joins the server. And as suggested above, the dialog wont go away until the player clicks on "I Accept" button. I guess we also need a button that says "I Decline" which would disconnect them from the server.
Work is in progress and I will have it working in a few hours or a day.
 
Last edited:
the TERMS of SERVICE dialog

Copy the tos folder into your mission folder. Edit your init.sqf (example included) by adding
Code:
[] execvm "tos\tos.sqf";
edit your description.ext (example included)
Code:
#include "tos\tos_defines.hpp"
#include "tos\tos_dialog.hpp"
If you use my help dialog, they both use the same includes so if you get an error, delete the #include for either tos or help.

Just like in my other help dialog, http://opendayz.net/threads/help-dialog.19407/ edit the tos.html for the main section and the tos_txt.html for the smaller upper left box.
I did not add an image as it is only going to be displayed one time and thought that would be a waste of 45kb of mission download.

This will be displayed ONLY the first time a player joins the server and they can NOT press escape to close it, they MUST press I AGREE.

Download ... www.killonsight.us/downloads/tos.zip

I wasn't going to post this yet, then changed my mind and decided to toss it up here just in case I forget about it. The 'possible' issue that I have not tested yet is that if you join a server and click on ACCEPT, the fact is saved in profilenamespace. What I don't know is if the profilenamespace variables are keyed to each server. If not then if you 'accept' on one server, then you would never see this dialog on any other server. If the variables are keyed to each server then this script is good to go. I will test this tommorrow hopefully.
 
Last edited:
I can edit the script to make it so it shows to every player every time they join and post that too. that was the original idea I guess, A news posting that they must read. Or maybe display only when its changed. That way once they see it, they wont be bothered again. if they go to another server the 'seen' key would be different and they would see that one. And if you change the script then your 'seen' key would be updated and players would see it again.
 
well i gota credit you for that piece of work.
Had been thinking about doing exactly the same a while ago when
i was reading in on dialogs and found the html stuff that can be done.

it is nicely done!
 
Back
Top