Sign in to follow this  
geekm0nkey

Suicide Vest Mini Game (WIP)

4 posts in this topic

I know, my coding needs are all over the place.. well here is something else I'm working on... But something is missing and doesn't work, maybe more eyes on can help me out.

Spoiler

private["_boom", "_list", "_timer", "_items"];

if !(ExilePlayerInSafezone) then
{
    if !(ExileClientIsHandcuffed) then
    {
        cutText [format["Ala Akuba!!!"], "PLAIN DOWN"];
        player say3D "akbar";
        
        removeUniform player;
        removeHeadgear player;
        removeAllAssignedItems player;
        player forceAddUniform  "CUP_O_TKI_Khet_Partug_04";
        player addHeadgear "H_ShemagOpen_khk";
        player addItemToUniform "Exile_Item_MobilePhone";

        _timer = 5;
        
        while (_timer >= 0) do {
            cutText [format["%1",_timer], "PLAIN DOWN"];
            _timer = _timer - 1;
            sleep 1;
        };
        
        _items = magazines player;
        
        if ("Exile_Item_MobilePhone" in _items) then
        {
            removeVest player;
            removeAllWeapons player:
            removeAllAssignedItems player;
            _boom = "HelicopterExploSmall" createVehicle [0,0,9999];
            _boom setPos (getPos player);
            _boom setVelocity [100,0,0];
            player setDamage 1;
        }else {
            ["InfoTitleAndText", ["Whoops", "Your vest was defused, better luck next time!"]] call ExileClient_gui_toaster_addTemplateToast;
        };
    }else{
        ["InfoTitleAndText", ["Whoops", "You are restrained!"]] call ExileClient_gui_toaster_addTemplateToast;
    };
}else{
    ["InfoTitleAndText", ["Whoops", "The vest failed to go off!"]] call ExileClient_gui_toaster_addTemplateToast;
};

What i want it to do is the follow.. in steps
1> not work in save zone with toast message,
2> not work while restrained with toast message,
3> announce intention
4> remove all gear, and replace with terrorist outfit, vest and phone,
5> start countdown timer
6> final check to see if phone still exist on vest. (if not toast)
7> remove all and detonate

Ideally this balances out the suicide vest to a point.. someone runs up or tries to sneak into a group (being a jerk) it announces and visually shows who the bomber is. Players have so many seconds to neutralize the bomber. If killed and phone removed then bomb is defused. Or if the bomber has second thoughts and dumps the phone also defuses.

Share this post


Link to post
Share on other sites
2 hours ago, geekm0nkey said:

I know, my coding needs are all over the place.. well here is something else I'm working on... But something is missing and doesn't work, maybe more eyes on can help me out.

  Hide contents

private["_boom", "_list", "_timer", "_items"];

if !(ExilePlayerInSafezone) then
{
    if !(ExileClientIsHandcuffed) then
    {
        cutText [format["Ala Akuba!!!"], "PLAIN DOWN"];
        player say3D "akbar";
        
        removeUniform player;
        removeHeadgear player;
        removeAllAssignedItems player;
        player forceAddUniform  "CUP_O_TKI_Khet_Partug_04";
        player addHeadgear "H_ShemagOpen_khk";
        player addItemToUniform "Exile_Item_MobilePhone";

        _timer = 5;
        
        while (_timer >= 0) do {
            cutText [format["%1",_timer], "PLAIN DOWN"];
            _timer = _timer - 1;
            sleep 1;
        };
        
        _items = magazines player;
        
        if ("Exile_Item_MobilePhone" in _items) then
        {
            removeVest player;
            removeAllWeapons player:
            removeAllAssignedItems player;
            _boom = "HelicopterExploSmall" createVehicle [0,0,9999];
            _boom setPos (getPos player);
            _boom setVelocity [100,0,0];
            player setDamage 1;
        }else {
            ["InfoTitleAndText", ["Whoops", "Your vest was defused, better luck next time!"]] call ExileClient_gui_toaster_addTemplateToast;
        };
    }else{
        ["InfoTitleAndText", ["Whoops", "You are restrained!"]] call ExileClient_gui_toaster_addTemplateToast;
    };
}else{
    ["InfoTitleAndText", ["Whoops", "The vest failed to go off!"]] call ExileClient_gui_toaster_addTemplateToast;
};

What i want it to do is the follow.. in steps
1> not work in save zone with toast message,
2> not work while restrained with toast message,
3> announce intention
4> remove all gear, and replace with terrorist outfit, vest and phone,
5> start countdown timer
6> final check to see if phone still exist on vest. (if not toast)
7> remove all and detonate

Ideally this balances out the suicide vest to a point.. someone runs up or tries to sneak into a group (being a jerk) it announces and visually shows who the bomber is. Players have so many seconds to neutralize the bomber. If killed and phone removed then bomb is defused. Or if the bomber has second thoughts and dumps the phone also defuses.

There were a few generic errors but let me know how this does:

try
{
	if (ExilePlayerInSafezone) throw "You cannot detonate the vest whilst in a safezone!";
	if (ExileClientIsHandcuffed) throw "You cannot detonate the vest whilst restrained!";

	cutText ["Ala Akuba!!!", "PLAIN DOWN"];
	player say3D "akbar"; // Note this sound is local to the client executing this, aka no one else will hear it.

	removeUniform player;
	removeHeadgear player;
	removeAllAssignedItems player;
	player forceAddUniform  "CUP_O_TKI_Khet_Partug_04";
	player addHeadgear "H_ShemagOpen_khk";
	player addItemToUniform "Exile_Item_MobilePhone";

	private _timer = 5;
	while (_timer >= 0) do
	{
		cutText [format["%1", _timer], "PLAIN DOWN"];
		_timer = _timer - 1;
		uiSleep 1;
	};

	if !("Exile_Item_MobilePhone" in (magazines player)) throw "Your vest was defused, better luck next time!";

	removeVest player;
	removeAllWeapons player;
	removeAllAssignedItems player;

	private _bomb = createVehicle ["SLAMDirectionalMine_Wire_Ammo", [0,0,0], [], 0, "CAN_COLLIDE"];
	_bomb setPosATL (getPosATL player);
	_bomb setDamage 1;

	//player setDamage 1; // The bomb will kill the player...
}
catch
{
	["InfoTitleAndText", ["Whoops", _exception]] call ExileClient_gui_toaster_addTemplateToast;
};

 

  • Like 1

Share this post


Link to post
Share on other sites
Advertisement

Out of curiosity, why change the explosive type? That part was working, what wasn't really was the count down timer. And thank you for the improvements. i will give it a test and see what happens.

 

Update: tested your explosion, difference seems that your doesn't leave a crater.. kinda like the crater.. lol

Edited by geekm0nkey
tested

Share this post


Link to post
Share on other sites

Ok, tested... No go... kinda does what my original one does.

player says "Ala Akuba!!!", out fit changes.. then nothing.. its like the counter function stops it for some reason? And actually, i really just need a delay between trigger and detonation to check for the phone, doesn't actually have to display anything.

 

Edited by geekm0nkey

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.