Sign in to follow this  
geekm0nkey

System message trigger?

5 posts in this topic

anyone wanna venture a guess as to why this doesn't work? Go ahead and assume the part of the code dealing with sunOrMoonand _atnightOnlywork perfectly (as they do else where in the code)
so sunOrMoon is 0 and _atnightOnly is true; Oh and this code is inside the file TriggerLoop.sqf inside of exilez/scripts. specifically what I am attempting here is to broadcast a message to players when _atnightOnly = true, sunOMoon=0 and _playerMsg=false; then after displaying the message set _playerMsg=true; to prevent a second display? or is there an easier better way?

_playerMsg = _triggerObj getVariable ["SeenMsg", false];
if (!(_playerMsg) && (_atnightOnly) && (sunOrMoon == 0)) then 
{
	[parseText format["<t size='0.6'font='OrbitronLight' color='#ffffff'>Zombies have been spotted in all the major cities.</t>"],0,1,10,0] spawn bis_fnc_dynamictext;
	if (EZM_ExtendedLogging) then
	{
		diag_log "ExileZ Mod: Displayed warning message to player";
	};
	_playerMsg = _triggerObj setVariable ["SeenMsg", true];
};

may need to me moved to programming, i think i posted in the wrong forum.. sorry.

Edited by geekm0nkey
may need to be moved.

Share this post


Link to post
Share on other sites

@geekm0nkey pretty sure the script is running server-side, sooo that means you have to tell clients to do the notification, not the server.

[parseText format["<t size='0.6'font='OrbitronLight' color='#ffffff'>Zombies have been spotted in all the major cities.</t>"],0,1,10,0] remoteExec ["bis_fnc_dynamictext", -2]

 

Edited by StokesMagee

Share this post


Link to post
Share on other sites
Advertisement
8 hours ago, StokesMagee said:

@geekm0nkey pretty sure the script is running server-side, sooo that means you have to tell clients to do the notification, not the server.


[parseText format["<t size='0.6'font='OrbitronLight' color='#ffffff'>Zombies have been spotted in all the major cities.</t>"],0,1,10,0] remoteExec ["bis_fnc_dynamictext", -2]

 

however the log doesn't even show where it attempted. I was thinking it is not even getting past the first if statement.

Share this post


Link to post
Share on other sites

How about I remove it from the mod all together and call it from the mission file.. as a file called zombiewarning.sqf with this content? would this work better?

private ["_zombieWarnings"];

if hasInterface then
{
	if isMultiplayer then
	{
		waitUntil { if (sunOrMoon == 0) then { true } else { uiSleep 0.5; false } };
		_zombieWarnings = 
		[
			"Zombies have been spotted in all the major cities.",
			"Zombie apocalypse has started!",
			"The zombie freaks come out at night!",
			"Haven't seen any zombies? Just wait, you will!",
			"What time is it? That's right, zombie time!"
		];
		[parseText format["<t size='0.6'font='OrbitronLight' color='#ffffff'>" + selectRandom _zombieWarnings + "</t>"],0,1,10,0] spawn bis_fnc_dynamictext;
	};
};

update: worked as intended, just wanted to added it to the mod.

Edited by geekm0nkey

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.