Jump to content
  • 0

Undefined Variable Error (Script works though?)


js2k6

Question

Hi everyone, having an issue with one of my scripts,

I have a loadout randomiser / humanity based loadout on my overpoch lingor server.

 

It seems to function exactly as it should, however it is throwing an error in my servers rpt that i would like to resolve.

20:59:07 Error in expression < player getVariable["humanity",0];

if((_getHumanity > -4999) && (_getHumanity <>
20:59:07   Error position: <_getHumanity > -4999) && (_getHumanity <>
20:59:07   Error Undefined variable in expression: _gethumanity
20:59:07 File mpmissions\__cur_mp.Lingor\scripts\DMDloadouts.sqf, line 44

this is the file in question

http://pastebin.com/aXSJmPym

 

thanks. 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

thanks, i'll try using your method to see if that works without throwing an error. 

I was just using the method my debug monitor uses to get a players humanity. 

 

edit: changed to 

_getHumanity = player getVariable "Humanity";

no joy unfortunately, the error must be coming from somewhere else?

22:01:49 Error in expression <y = player getVariable "Humanity";

if((_getHumanity > -4999) && (_getHumanity <>
22:01:49   Error position: <_getHumanity > -4999) && (_getHumanity <>
22:01:49   Error Undefined variable in expression: _gethumanity
22:01:49 File mpmissions\__cur_mp.Lingor\scripts\DMDloadouts.sqf, line 44
22:01:49 "[AGN] Starting Trader City Safezone Commander!"

it does state that the error is on line 44? 

is there something wrong with this if statement?

if((_getHumanity > -4999) && (_getHumanity < 4999)) then {
Link to comment
Share on other sites

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
  • Advertisement
  • Discord

×
×
  • Create New...