PreedSwe 18 Posted March 29, 2012 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
gammadust 12 Posted March 29, 2012 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
xeno 234 Posted March 29, 2012 (edited) 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 March 29, 2012 by Xeno Share this post Link to post Share on other sites
gammadust 12 Posted March 29, 2012 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
PreedSwe 18 Posted March 29, 2012 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
gammadust 12 Posted April 7, 2012 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
PreedSwe 18 Posted April 7, 2012 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
gammadust 12 Posted April 7, 2012 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
PreedSwe 18 Posted April 7, 2012 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