Page 1 of 1
get holster status
Posted: Sun Apr 24, 2005 7:32 pm
by oddball
is there a way to get the status of a player ? i wanna see it in a MP script if the player holsters his/her weapon
other question, as you know, a NIL causes probs in the scripts, is there a good way to get around it ? something like if(local.tester == NIL)
I tried that one but without luck.
it doesn't help to first set it on 0 in my script as it gets a Cvar, when that one is empty, it overwrites it and is NIL again.
So i need something to detect the empty one and then fill it..
Re: get holster status
Posted: Sun Apr 24, 2005 8:29 pm
by Rookie One.pl
oddball wrote:is there a way to get the status of a player ? i wanna see it in a MP script if the player holsters his/her weapon
Via state files, yes.
oddball wrote:other question, as you know, a NIL causes probs in the scripts, is there a good way to get around it ? something like if(local.tester == NIL)
I tried that one but without luck.
Try again, it works.

You should also check if it's not NULL either.
oddball wrote:it doesn't help to first set it on 0 in my script as it gets a Cvar, when that one is empty, it overwrites it and is NIL again.
So i need something to detect the empty one and then fill it..
The getcvar command always returns a string. If a cvar is not set, you'll get an empty one - "".
Posted: Mon Apr 25, 2005 12:33 am
by lizardkid
Technically, since NIL and NULL both represent 0 as constants, aren't they interchangeable?
Posted: Mon Apr 25, 2005 1:52 am
by mefy
NIL and NULL are two completely different things which have nothing to do with 0.
NIL means a variable isn't set. NULL means it refers to an object that was deleted. They both would be considered 'false' in an if/while statement which is probably why people think they're 'interchangable'.
Posted: Mon Apr 25, 2005 1:02 pm
by Rookie One.pl
That's right. They represent nothing. Absolutely nothing.

Posted: Tue May 24, 2005 8:42 pm
by oddball
ok, can you give me more clues? like how i have to handle a state file..
and what about if its NULL ? keep on getting those errors
Posted: Wed May 25, 2005 10:36 am
by Rookie One.pl
State files are the mike_*.st files in the global directory. They're pretty straightforward.
NIL = a thing which never existed.
NULL = a thing which once existed but does not anymore.