Results 1 to 9 of 9

Thread: = nil?

  1. #1

    = nil?

    Are there any other ways to destroy variables other than = nil?
    The reason I ask is that certain badly coded cheats(*************** 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

  2. #2
    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)

  3. #3
    Quote Originally Posted by PreedSwe View Post
    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
    Code:
    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
    Last edited by Xeno; Mar 29 2012 at 19:25.

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

    indeed the nil article at the wiki mentions this:

    Quote Originally Posted by Worldeater
    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"

  5. #5
    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?

  6. #6
    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:
    Code:
    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

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

  8. #8
    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.

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

Similar Threads

  1. Nul/nill/0 instead of nil as script handle
    By Celery in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 4
    Last Post: Jan 30 2011, 12:14
  2. 'warning nil variable overridden...'
    By R.Flagg in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 5
    Last Post: Jan 23 2011, 22:14
  3. Warning: Nil variable overriden;
    By PartyHead in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 3
    Last Post: Nov 20 2010, 09:38
  4. Ignore assigning to nil
    By alef in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 2
    Last Post: Jun 2 2010, 18:04

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •