Jump to content
Sign in to follow this  
anthonyfromtheuk

god mode on and off via action menu

Recommended Posts

I am currently using 2 options in the action menu to turn god mode on and off. Added with this below.

godModeOn = Player addaction
[("<t color=""#ffff33"">" + ("God Mode on") + "</t>"),"TestUnitScripts\godmodeon.sqf"];

godModeOff = Player addaction
[("<t color=""#ffff33"">" + ("God Mode off") + "</t>"),"TestUnitScripts\godmodeoff.sqf"];

godmodeon.sqf

player allowdamage false;
hintSilent "God Mode Enabled";
Sleep 5;
hintSilent "";

godmodeoff.sqf

player allowdamage true;
hintsilent "God Mode Disabled";
Sleep 5;
hintsilent "";

What I would like to do is turn that into one option in the action menu so that I can just toggle god mode on and off and the text color to change. say green if its on and red if its off. Can anybody help?

Share this post


Link to post
Share on other sites

init.sqf

player addAction [("<t color='#66FF33'>" + ("God Mode on") + "</t>"),"godModeOn.sqf"];

godModeOn.sqf

_host = _this select 0;
_caller = _this select 1;
_id = _this select 2;

_host removeAction _id;

_caller allowDamage false;
hintSilent "God Mode Enabled";

_caller addAction [("<t color='#E64848'>" + ("God Mode off") + "</t>"),"godModeOff.sqf"];

godModeOff.sqf

_host = _this select 0;
_caller = _this select 1;
_id = _this select 2;

_host removeAction _id;

_caller allowDamage true;
hintSilent "God Mode Disabled";

_caller addAction [("<t color='#66FF33'>" + ("God Mode on") + "</t>"),"godModeOn.sqf"];

Share this post


Link to post
Share on other sites

I see you this mission on STEAM:

http://steamcommunity.com/sharedfiles/filedetails/?id=234426763

This script is a poor versionof my own script VDEBUG.

http://forums.bistudio.com/showthread.php?171094-VDEBUG-1-0-light-script-to-debug-missions-with-vehicles

You can use the script for your own missions but you must add credits ( or ask permissions) for publishing.

My own script is under Creative Commons license :

https://creativecommons.org/licenses/by/3.0/es/

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  

×