Last active
January 21, 2020 05:54
-
-
Save AgentRev/1e328573fda045614ea21bfd827f5f0b to your computer and use it in GitHub Desktop.
Improved High Value Target script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @file Version: 2.0 | |
// @file Name: HvT.sqf | |
// @file Author: Cael817, CRE4MPIE, LouD, AgentRev | |
#define HVT_AMOUNT 50000 // how much a player needs to be carrying to become a HvT | |
#define HINT_DELAY 60 // number of seconds between each HvT reminder hint | |
#define MARKER_REFRESH 30 // number of seconds between each HvT marker refresh | |
if (isServer) then | |
{ | |
addMissionEventHandler ["PlayerDisconnected", { deleteMarker ("HvT_" + (_this select 1)) }]; | |
}; | |
if (!hasInterface) exitWith {}; | |
waitUntil {sleep 0.1; alive player && !(player getVariable ["playerSpawning", true])}; | |
_lastHint = -HINT_DELAY; | |
_lastMarker = -MARKER_REFRESH; | |
_markerTarget = objNull; | |
_hasMarker = false; | |
while {true} do | |
{ | |
_isHvT = (player getVariable ["cmoney",0] >= HVT_AMOUNT && alive player && !(player getVariable ["playerSpawning", true])); | |
if (_isHvT && diag_tickTime - _lastHint >= HINT_DELAY) then | |
{ | |
hint parseText ([ | |
"<t color='#FF0000' size='1.5' align='center'>High Value VIP</t>", | |
//profileName, | |
"<t color='#FFFFFF' shadow='1' shadowColor='#000000' align='center'>Someone has spotted you carrying a large sum of money and has marked your location on the map!</t>" | |
] joinString "<br/>"); | |
_lastHint = diag_tickTime; | |
//playSound "Topic_Done"; | |
}; | |
if (diag_tickTime - _lastMarker >= MARKER_REFRESH || (!alive _markerTarget && _hasMarker)) then | |
{ | |
_markerName = "HvT_" + getPlayerUID player; | |
if (_hasMarker) then | |
{ | |
deleteMarker _markerName; | |
_hasMarker = false; | |
}; | |
if (_isHvT) then | |
{ | |
createMarker [_markerName, getPosWorld player]; | |
_markerName setMarkerColor "ColorRed"; | |
_markerName setMarkerText format [" VIP: %1 ($%2k)", profileName, (floor ((player getVariable ["cmoney",0]) / 1000)) call fn_numToStr]; | |
_markerName setMarkerSize [0.75, 0.75]; | |
_markerName setMarkerShape "ICON"; | |
_markerName setMarkerType "mil_warning"; | |
_lastMarker = diag_tickTime; | |
_markerTarget = player; | |
_hasMarker = true; | |
playSound "Topic_Done"; | |
}; | |
}; | |
sleep 0.5; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would there be any chance of you streamlining the High Value Drugsrunner script (that i think LouD did) in the same way that you did for the HvT script please?? It was pretty much a clone of the HvT script but using drugs instead of money. I have had several goes at it but i cant get it to fly as i am a retarded n00b. It currently contains your favourite line of code he he: for "_i" from 0 to 1 step 0 do