PDA

View Full Version : GSC GetArrayKeys



php
26th April 2015, 21:50
Requested by IzNoGoD

left CoD2 1.0 out as it's easy to get the offsets if you compare them with the other cod2 patches.

(If you're gonna rip code, please leave a thanks/credit)

https://gist.github.com/riicchhaarrd/2770cd9ae3b075bd4234

Ni3ls
27th April 2015, 09:37
What does it do exactly?

kung foo man
27th April 2015, 09:59
HEY YOU'RE AWESOME

Should work like this:


arr = [];
arr["a"] = 1;
arr["b"] = "two";
arr["c"] = 3.333;

keys = getArrayKeys(arr);
// keys[0] will be "a"
// keys[1] will be "b"
// keys[2] will be "c"


It makes some scripting much easier, without some hackery to save the keys of an array in an extra array.