• 0
BetterDeadThanZed

Need help with wages code

Question

I use JohnO's Exile Reborn mod and part of that mod includes getting wages. This file detects if you are within a trader safe zone and if you are, it won't let you get wages. Since i don't use safezones, I'd like to change this to detect if someone is within a territory that they have build rights in, and if they are, it doesn't give them wages. Here's the code: https://github.com/gianni001/ExileReborn/blob/master/%40ExileServer/addons/JohnOs_events/addons/Functions/Server/JohnO_fnc_wages.sqf

I tried changing this line:

if !([getPos _x, 0] call ExileTerritoryBuildRights) then

I ended up with this error in my server log:

14:09:32 Error in expression <ive _x) then
{
if !([getPos _x, 0] call ExileTerritoryBuildRights) then
{	

_pla>
14:09:32   Error position: <ExileTerritoryBuildRights) then
{	

_pla>
14:09:32   Error Undefined variable in expression: exileterritorybuildrights
14:09:32 File JohnOs_events\addons\functions\Server\JohnO_fnc_wages.sqf, line 10

If anyone has any suggestions, please let me know!

Share this post


Link to post
Share on other sites

37 answers to this question

  • 0
11 minutes ago, Beowulfv said:

What if you used "call ExileClient_util_world_isInOwnTerritory"?

I'm not sure that work for people with build rights (not the owner) but I'll give it a try.

Share this post


Link to post
Share on other sites
Advertisement
  • 0

My think is that build rights calls to it because it's what gives players the construction attributes in-game.

Share this post


Link to post
Share on other sites
  • 0

I tried "ExileClient_util_world_isInOwnTerritory" and I still got paid inside of my territory. This is the error:

14:36:13 Error in expression <h
{
_flag = _x;
};
}
forEach (_position nearObjects ["Exile_Construction_Flag_St>
14:36:13   Error position: <nearObjects ["Exile_Construction_Flag_St>
14:36:13   Error Type Array, expected Number
14:36:13 File exile_client\code\ExileClient_util_world_getTerritoryAtPosition.sqf, line 23

 

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, exilerist said:

Hello there.

How exactly you called "ExileClient_util_world_isInOwnTerritory"?

I changed this:

if !([getPos _x, 0] call ExileTerritoryBuildRights) then

to this:

if !([getPos _x, 0] call ExileClient_util_world_isInOwnTerritory) then

 

Share this post


Link to post
Share on other sites
  • 0
2 hours ago, deadeye2 said:

ExileClient_util_world_isInOwnTerritory only needs the position.

Try removing the ,0

I tried it and I continue to get paid in and out of my territory and this error is in my log, same as before:

10:35:55 Error: Object(3 : 56) not found
10:36:06 Error in expression <h
{
_flag = _x;
};
}
forEach (_position nearObjects ["Exile_Construction_Flag_St>
10:36:06   Error position: <nearObjects ["Exile_Construction_Flag_St>
10:36:06   Error 1 elements provided, 3 expected
10:36:06 File exile_client\code\ExileClient_util_world_getTerritoryAtPosition.sqf, line 23

 

Share this post


Link to post
Share on other sites
  • 0

Try this...

replace the "if" line with this:

_flag = (getPos _x) nearestObject "Exile_Construction_Flag_Static";
_radius = _flag getVariable ["ExileTerritorySize", -1];
if ((_x distance _flag) > _radius) then

 

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.