kuplion

[Request] Suicide cooldown or remove suicide option.

8 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
 * exile.majormittens.co.uk
 * © 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
 * exile.majormittens.co.uk
 * © 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;

 

  • Like 1

Share this post


Link to post
Share on other sites
On 2/28/2017 at 0:16 PM, sjJACKit said:

cannot see the alternative code that you suggested

Heya, modify ExileClient_gui_escape_suicide.sqf  and replace this line:

["whoops", [_nahBruh]] call ExileClient_gui_notification_event_addNotification;

with this line:

["InfoTitleAndText",_nahBruh]] call ExileClient_gui_toaster_addTemplateToast;

This uses the toast notifications that were brought in a while back

Cheers

Edited by Jerrico

Share this post


Link to post
Share on other sites

Does this still work?

Edit.. I think I found why it wasn't working.. the bottom part of the text is missing a [
Should be ["InfoTitleAndText",[_nahBruh]] call ExileClient_gui_toaster_addTemplateToast;

Edited by Slider

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.