BetterDeadThanZed

Add rope requirement to Advanced Urban Rappelling

21 posts in this topic

2 hours ago, BetterDeadThanZed said:

I'm using Advanced Urban Repelling: http://www.armaholic.com/page.php?id=31357

Does anyone know of a way to require a player to have a rope in order to use this?

You can try adding this to your init.sqf file.
 

[] spawn {
waitUntil {!isNil "AUR_Rappel_Action_Check"};
AUR_Rappel_Action_Check = {
    params ["_player"];
    if(_player getVariable ["AUR_Is_Rappelling",false]) exitWith {false;};
    if(vehicle _player != _player) exitWith {false;};
    if(([_player] call AUR_Get_Player_Height_Above_Ground) < 4) exitWith {false};
    if!([_player,"FAST_EXISTS_CHECK"] call AUR_Find_Nearby_Rappel_Point) exitWith {false;};
    if(count ([_player,"POSITION"] call AUR_Find_Nearby_Rappel_Point) == 0) exitWith {false;};
    if!("Exile_Item_Rope" in magazines _player) exitWith {false};
    true;
	};
};

Tested and it works.

 

**EDIT**

Edited by Beowulfv
1 person likes this

Share this post


Link to post
Share on other sites
Advertisement

Hello Zed,

I think you will have to mod the actual script itself.  Every time it is 'activated', it would check to see if you have the rope and if not there, exit with a message.

Otherwise, you would have to write an 'outside of the mod' script to check for rope every ?.1? seconds (if not more often) and if not present and 'rappel' menu is showing, remove the menu item and 'repeat'.  This would waste a lot of cpu cycles for nothing.

 

Stop and think about it:

I have rope now - Rappel = Works

I respawn/drop/lose/sell the rope - Rappel = Fail

This 'check' would have to be made over and over every second the player is on.  An 'one time' check would not work, it MUST be constant.

 

ME?  I would re-write the actual script and push it out as a 'custom mod' that your players would have to get.  No 'wasted' cpu cycles until player tries to activate the script.  Only problem with this method is the player will not know this till they try to rappel and get a 'surprise'.  This could be addressed by changing the 'addmenu' text, as an example when they get next to a rooftop and it activates:

Player has no rope addmenu text - "Rope Needed For Rappel" - If selected, it aborts the script

Player has rope addmenu text - "Rappel" (normal text) - Runs normally

 

I could very well be wrong, but I think these will be about the only options...

???

:)

 

 

Edited by Z80CPU

Share this post


Link to post
Share on other sites
59 minutes ago, BetterDeadThanZed said:

Thanks for trying but that didn't work. No errors in the logs either.

Sorry forgot a close bracket. I just tested it and it works fine. Original post has been updated for you to copy. 
 

@Z80CPU Everything is customizable, just gotta know what to call.

Share this post


Link to post
Share on other sites

Hahahah - Thus why I stated:  "...I could very well be wrong..."

 

;)

 

 

Share this post


Link to post
Share on other sites
1 hour ago, Beowulfv said:

Sorry forgot a close bracket. I just tested it and it works fine. Original post has been updated for you to copy. 

Works great! Thanks!

Share this post


Link to post
Share on other sites
11 hours ago, Beowulfv said:

Sorry forgot a close bracket. I just tested it and it works fine. Original post has been updated for you to copy. 

didnt work for me :(

i have those error:

Quote

11:17:43 Error in expression <on_Check"};
AUR_Rappel_Action_Check = {
    params ["_player"];
    if(_pl>
11:17:43   Error position: <    params ["_player"];
    if(_pl>
11:17:43   Error Invalid number in expression
11:17:43 File mpmissions\__cur_mp.Tanoa\init.sqf, line 37
11:17:43 Error in expression <on_Check"};
AUR_Rappel_Action_Check = {
    params ["_player"];
    if(_pl>
11:17:43   Error position: <    params ["_player"];
    if(_pl>
11:17:43   Error Invalid number in expression
11:17:43 File mpmissions\__cur_mp.Tanoa\init.sqf, line 37

 

Share this post


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

didnt work for me :(

i have those error:

 

I would say check your mod and check your copy of the source code above.

Share this post


Link to post
Share on other sites

ok im going to test with armaholic version

Same problem :(

Edited by Hakimos

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.