Jump to content

Recommended Posts

Are there any other ways to destroy variables other than = nil?

The reason I ask is that certain badly coded cheats(darky etc) do crap like nil = "point/to/script.sqf";

Which when someone comes on the server using that shit, causes more destruction to the running mission than the actual bloody cheat itself by starting to point variables to scripts and crap..

Is it maybe possible to do this?

In init.sqf

myownnil = nil;

Then use destroythisvariable = myownnil;

without myownnil being affected in case nil gets overwritten?

/ Preed

Share this post


Link to post
Share on other sites

I never come across this issue, could you provide a reproducible example were the variable is overwriten? This looks like something one should be aware.

i think i seen before a handle to a script named nil and variable destruction mixed without observing any overwrite...

(afaik there is no other way to destroy a variable)

Share this post


Link to post
Share on other sites

Is it maybe possible to do this?

In init.sqf

myownnil = nil;

Then use destroythisvariable = myownnil;

without myownnil being affected in case nil gets overwritten?

Not possible. Once a global variable named nil "overwrites" the game engine nil its gone.

@gammadust

nil = execVM "bla.sqf";
somevar = nil;
if (isNil "somevar") then {... // does not work anymore, somevar is not nil but contains the handle of the execVM

Xeno

Edited by Xeno

Share this post


Link to post
Share on other sites

well, thanks to keep this in mind will save some headaches...

indeed the nil article at the wiki mentions this:

Never ever assign a value to nil!

Doing so creates a global variable with the same name that overrides the "command" nil:

foo = "foo";

nil = "bar";

foo = nil;

hint foo; // displays "bar"

Share this post


Link to post
Share on other sites

So... A) For what reason is it possible to overwrite nil? I mean, you cant overwrite /dev/null... This seems stupid...

B) Is there really no other way to destroy a variable, other than use this flawed method?

Share this post


Link to post
Share on other sites

Well, engine's idiosyncrasies. Being aware of it allows you to prevent to bump into it. In regards to what is off one's control (scripts which assign anything to that command in bad practice), at the lack of better solution, you're left with modifying them to suit your needs.

maybe this will give you a hint about why engine works that way:

I did some testing. I think this command should be spelled "nill". "nil" does nothing, while "nill" deletes the variable. This spelling mistake has been around since the OFP scripting reference. --Maddmatt 15:43, 29 September 2007 (CEST)

Are you sure? This works fine:

AVAR="A" ; AVAR=Nil ; Hint Format ["Var %1 IsNil %2",AVAR,IsNil "AVAR"]; 

UNN 20:54, 29 September 2007 (CEST)

nil is correct. There is nothing like nill. (Because of the way Void values are handled nill may appear to be working, because it is handled as undefined variable) --Suma 22:45, 29 September 2007 (CEST)

here

we'll have to make do :)

Share this post


Link to post
Share on other sites

I can avoid messing that up personally, its those useless programmers that make hacks/cheats that mess it up(darky etc).. So when someone with darky comes on our server, the mission gets fucked up...

Share this post


Link to post
Share on other sites

are they bypassing server signature checks or smtg?

I am totaly newb in regards to running a server, but this and this maybe worthwhile.

best luck dealing with those griefers.

Share this post


Link to post
Share on other sites

We are using v2 signatures already.. But there are some hacks apparently that can bypass it.. Not sure if darky is still being developed though.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×