Jump to content
  • 0
Sign in to follow this  
lucho

Suicide in safezone false

Question

How i can make that people can not suicide near safezone?

 

suicide.sqf
 

private ["_position","_done","_timeLeft","_exitWith","_warning","_display","_weapon"];

// initialize variables
_weapon   = _this;
_exitWith = "nil";
_done     = false;
_position = position player;
_timeLeft = DZE_SUICIDE_CANCEL_TIME;
_warning  = "You will commit suicide in %1 seconds. Move to cancel!";
removeAllWeapons player;
	removeAllItems player;
	removeBackpack player;
// close the gear display when player starts to commit suicide
disableSerialization;
_display = findDisplay 106;
if(!(isNull _display)) then {
    _display closeDisplay 0;
};
	

// if we didn't get an exit reason back, time to die!
if (_exitWith == "nil") then {
    _exitWith = "Goodbye!";
    taskHint[_exitWith, DZE_COLOR_SUCCESS, "taskDone"];
    hint _exitWith;
    cutText[_exitWith,"PLAIN DOWN"];
    player selectWeapon _weapon;
    player switchMove "";
    player playActionNow "stop";
    player playMove (["ActsPercMstpSnonWpstDnon_suicide1B","ActsPercMstpSnonWpstDnon_suicide2B"] call BIS_fnc_selectRandom);
    sleep 7.5;

    player fire _weapon;
    sleep 1;
    player setDamage 1.5;
} else {
    taskHint[_exitWith, DZE_COLOR_DANGER, "taskFailed"];
    cutText[_exitWith,"PLAIN DOWN"];
};

 

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Find this:

if (_exitWith == "nil") then {

and replace it with:

if (_exitWith == "nil" && !inSafeZone) then {

 

Keep in mind this will only work if you have the safezone defined as a trader city in the mission.sqm

Let me know how it works :)

Share this post


Link to post
Share on other sites
  • 0

This is an old suicide script that seemed to stop people attempting to dupe, a long long time ago. Don't know if it still works.

Spoiler

private ["_Secondary"];
_Secondary = currentWeapon player;
suicide_answer=nil;
canAbort = true;
Damisscum = 
[
    ["Suicide Confirmation",true],
    ["Are you sure?", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["", [-1], "", -5,         [["expression", ""]], "1", "0"],
    ["No", [2], "", -5,     [["expression", "suicide_answer=false;"]], "1", "1"],
    ["Yes", [3], "", -5,     [["expression", "suicide_answer=true;"]], "1", "1"],
    ["", [-1], "", -5,         [["expression", ""]], "1", "0"],
    ["Exit", [-1], "", -3,     [["expression", "suicide_answer=false;"]], "1", "1"]
];
showCommandingMenu "#USER:Damisscum";
waitUntil {((!isNil 'suicide_answer')||(commandingMenu == ""))};
if (isNil 'suicide_answer') then {suicide_answer=false;};
if (suicide_answer) then
{
    canAbort = false;
    if (inSafeZone) exitWith {
        inSafeZone = false;
        {player removeMagazine _x} forEach magazines player;
        removeAllWeapons player;
        removeBackpack player;
        removeAllItems player;
        _txt = "Trying to dupe in safezones, are we? Your IP, GUID, and player name has been logged.";
        cutText [_txt,"PLAIN DOWN"];
        systemChat ("Anti-Hack: "+STR _txt+"");
        sleep 5;
        (vehicle player) setVelocity [-500,(random 500),500];
        SafeZoneDupe = "I TRIED TO SUICIDE IN SAFEZONE";
        sleep 1.5;
        (vehicle player) setVelocity [(random 500),-500,-5000];
        sleep 5;
        player setHit ["Head",1];
        [] spawn player_death;
        sleep 1;
        publicVariable "SafeZoneDupe";
    };
    player playmove "ActsPercMstpSnonWpstDnon_suicide1B";
    sleep 8.4;
    player fire _Secondary;
    _unit = player;
    _selection = "body";
    _damage = 1;
    _unit setHit[_selection,_damage];
} else {
    systemChat ("Suicide canceled.");
};

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...