get holster status

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
oddball
Corporal
Posts: 44
Joined: Tue May 27, 2003 3:49 pm
Contact:

get holster status

Post 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..
[VS-UK]Maj.OddBall[BnHQ]
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Re: get holster status

Post 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 - "".
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

Technically, since NIL and NULL both represent 0 as constants, aren't they interchangeable?
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
mefy
Corporal
Posts: 33
Joined: Tue Oct 21, 2003 2:57 am

Post 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'.
New Gametypes for Medal of Honor
Capture-The-Flag | Freeze-Tag | Demolition
www.planetmedalofhonor.com/mefy
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

That's right. They represent nothing. Absolutely nothing. ;)
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
User avatar
oddball
Corporal
Posts: 44
Joined: Tue May 27, 2003 3:49 pm
Contact:

Post 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
[VS-UK]Maj.OddBall[BnHQ]
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post 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.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Post Reply