Maaaaark

hourly server broadcast messages

26 posts in this topic

Advertisement
/******************************************************************
Advertise.sqf 
ver 1.0
(from a wasteland release, sorry, cant recall which one)

Waits 3 minutes for server to be running for first message then 
writes a message on players screen every X seconds (_delay)
List each message on a separate line [your message], and end with a 
comma EXCEPT the last message, no comma for last element of an array.

Include this file in your mission folder and in your init.sqf
add this line
if (!isserver) then {[]execvm "advertise.sqf";};
*******************************************************************/

_delay = 300;//5 minutes
sleep 180; // 3 minutes delay until first message
_messageArray = [
	["The fasted way to contact an admin is to join our teamspeak and ask for help."],
	["Join up on our website and take part in the discussions"],
	["Dont be a victim, Shoot First and SURVIVE!"],
	["The server restarts every 6 hours"]
];

while {true} do
{
	sleep _delay;
	_msg = _messageArray select (random (count _messageArray - 1));
	titleText [_msg, "PLAIN DOWN", 3];
};

 

Edited by ShootingBlanks
  • Like 2

Share this post


Link to post
Share on other sites
/******************************************************************
Advertise.sqf 
ver 1.0
(from a wasteland release, sorry, cant recall which one)

Waits 3 minutes for server to be running for first message then 
writes a message on players screen every X seconds (_delay)
List each message on a separate line [your message], and end with a 
comma EXCEPT the last message, no comma for last element of an array.

Include this file in your mission folder and in your init.sqf
add this line
if (!isserver) then {[]execvm "advertise.sqf";};
*******************************************************************/

_delay = 300;//5 minutes
sleep 180; // 3 minutes delay until first message
_messageArray = [
	["The fasted way to contact an admin is to join our teamspeak and ask for help."],
	["Join up on our website and take part in the discussions"],
	["Dont be a victim, Shoot First and SURVIVE!"],
	["The server restarts every 6 hours"]
];

while {true} do
{
	sleep _delay;
	_msg = _messageArray select (random (count _messageArray - 1));
	titleText [_msg, "PLAIN DOWN", 3];
};

 

Can you post a screenshot of how it looks? Would be much appreciated! :P

Share this post


Link to post
Share on other sites

 

 

i dont know why you wanted a screenshot. it looks the same as the written code :P:P

QuickMemo+_2015-10-07-13-12-24.png

 

just trolling some.  i am at work.  when i get home i will install this script on a server and take a few shots with different display configurations. 

Edited by ShootingBlanks
  • Like 4

Share this post


Link to post
Share on other sites

Okay, I tested the script by going into the editor and creating a radio alpha trigger and pasting the code into the activation box.  the text is centered but a bit small,

arma3_2015-10-07_14-38-21-480.thumb.jpg.

So I changed the text to bis_fnc_dynamictext and tested that out
This is probably the best because you can control the color, font, size, location, fadein .... 
 [  "<t size='.65' color='1cee09' align='left' font='PuristaSemibold'>'This is an example message'<br /></t>", -1,-1,4,1,0,789 ] spawn BIS_fnc_dynamicText;
arma3_2015-10-07_15-03-51-348.thumb.jpg.

And then there is the HINT box
hint "this is an example message";
arma3_2015-10-07_15-05-07-231.thumb.jpg.

 

Share this post


Link to post
Share on other sites

this bit of text was in the top of the code I posted

Include this file in your mission folder and in your init.sqf
add this line
if (!isserver) then {[]execvm "advertise.sqf";};

So create a file named advertise.sqf, paste the code into the file, and in the initplayerlocal.sqf add execvm "advertise.sqf".   Or something like this at your preference.

Edited by ShootingBlanks

Share this post


Link to post
Share on other sites

where would we add this in 

[  "<t size='.65' color='1cee09' align='left' font='PuristaSemibold'>'This is an example message'<br /></t>", -1,-1,4,1,0,789 ] spawn BIS_fnc_dynamicText;

 

Share this post


Link to post
Share on other sites

in the sqf code i pasted.  that is the line to display the text which would replace the titletext line.

the code randomizes the messages and puts it into a local variable named _msg

so to use the dynami  text replace

titleText [_msg, "PLAIN DOWN", 3];

with 

[  "<t size='.65' color='1cee09' align='left' font='PuristaSemibold'>_msg<br /></t>", -1,-1,4,1,0,789 ] spawn BIS_fnc_dynamicText

 

screen positioning is something i have never fully grasped, what i do is use the dialog editor to create an object and then just use those coordinates in my text display.  later (at work again) i can make a full file with options for different placements easily selectable.  i will include a jpg showing the placements.

 

 

 

  • Like 1

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.