kuplion

[Request] Suicide cooldown or remove suicide option.

5 posts in this topic

We have quite a bad issue of players farming spawn vehicles on our server, finding a car, driving it to Terminal to sell it, then just commit suicide back to a Spawn Zone to collect another vehicle to go and sell.

I don't want to adjust the vehicle spawns as our legitimate players appreciate them, but we're struggling to find a solution outside of a cooldown timer on suicides or the removal of the option entirely.

Would anyone be able to help with implementing either a cooldown or the removal of the suicide option?

Share this post


Link to post
Share on other sites
Advertisement

@oSoDirty helped me with this and it seems to work well.

 

And here are the working code snippets:

ExileClient_gui_escape_suicide.sqf

/**
 * ExileClient_gui_escape_suicide
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
_canSuicide = missionNamespace getVariable "suicideCountDown";
_difference = _canSuicide - time;
if (time < _canSuicide) exitWith {
	_display = findDisplay 49;
	_display closeDisplay 2;
	_nahBruh = format ["Sorry %1, you must wait at least %2 seconds before you can commit suicide!", name player, floor _difference];
	["whoops", [_nahBruh]] call ExileClient_gui_notification_event_addNotification;
};
private["_result","_display"];
disableSerialization;
_result = ["Do you really want to end your life?", "Confirm", "Yes", "Nah"] call BIS_fnc_guiMessage;
waitUntil { !isNil "_result" };
if (_result) then
{
	_display = findDisplay 49;
	if !(isNull _display) then
	{
		_display closeDisplay 2; 
	};
	player allowDamage true;
	player setDamage 1;
};
true

ExileClient_object_player_event_onKilled.sqf

/**
 * ExileClient_object_player_event_onKilled
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
closeDialog 0;
ExileClientLastDiedPlayerObject = player;
ExileClientIsAutoRunning = false;
if !((vehicle player) isEqualTo player) then
{
	unassignVehicle player; 
	player action ["GetOut", vehicle player]; 
	player action ["Eject", vehicle player];
};
setGroupIconsVisible [false, false];
false call ExileClient_gui_hud_toggle;
[] call ExileClient_object_player_event_unhook;
if !(ExileClientLastDeathMarker isEqualTo "") then 
{
	deleteMarkerLocal ExileClientLastDeathMarker;
};
ExileClientLastDeathMarker = createMarkerLocal [format ["Death%1", time], getPos player];
ExileClientLastDeathMarker setMarkerShapeLocal "ICON";
ExileClientLastDeathMarker setMarkerTypeLocal "KIA";
ExileClientLastDeathMarker setMarkerColorLocal "ColorRed";
ExileClientLastDeathMarker setMarkerAlphaLocal 0.5;
if (ExileClientIsInBush) then 
{
	call ExileClient_object_bush_detach;
};
if !(ExileClientBreakFreeActionHandle isEqualTo -1) then 
{
	player removeAction ExileClientBreakFreeActionHandle;
	ExileClientBreakFreeActionHandle = -1;
};
ExileClientIsHandcuffed = false;
ExileClientHostageTaker = objNull;
_hold = 300;															// Time in seconds for player to wait. Default 300 (5min)
canSuicide = time + _hold;         
missionNamespace setVariable ["suicideCountDown", canSuicide];
[] call ExileClient_system_breathing_event_onPlayerDied;
[] call ExileClient_system_snow_event_onPlayerDied;
[] call ExileClient_system_radiation_event_onPlayerDied;

 

1 person likes this

Share this post


Link to post
Share on other sites
3 hours ago, Spackler said:

Does anyone have this working in 1.0?

Considered using this instead?

 

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.