Thread: Arrays

Results 1 to 6 of 6
  1. #1
    edub18's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Germany
    Posts
    146
    Reputation
    10
    Thanks
    12
    My Mood
    Bored

    Arrays

    Hey, i'm tryin to save a list of weapons in an array:
    Code:
      self.CustomArray = [];
      self.CustomArray[0] = "USP.45";
      self.CustomArray[1] = "Intervention";
    But i cant read it this way:
    Code:
    onPlayerSpawned()
    {
    	self endon("disconnect");
    
    	for(;;)
    	{
    		self waittill("spawned_player");
    		self thread maps\mp\gametypes\_hud_message::hintMessage(self.CustomArray(1));
    	}
    When i try to start a private match with that script, i only get an error and there are no clues in the console. Someone can help me?

  2. #2
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,819
    Reputation
    3301
    Thanks
    73,607
    My Mood
    Breezy
    Shouldn't it be
    self.CustomArray[1]?
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.6.1 *NEW* Windows 10 compatible!
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  3. #3
    Insane's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    9,055
    Reputation
    1007
    Thanks
    1,999
    Somethings wrong I think,
    Code:
    		self thread maps\mp\gametypes\_hud_message::hintMessage(self.CustomArray(1));
    And I also think you forgot to specify a value here,
    Code:
      self.CustomArray = [];
    Maybe add = [1] or something.

  4. #4
    mathieutje12's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Close to my PC
    Posts
    578
    Reputation
    14
    Thanks
    165
    My Mood
    Angelic
    Did u use the right weapon codes?

  5. #5
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,819
    Reputation
    3301
    Thanks
    73,607
    My Mood
    Breezy
    No, I'm pretty sure self.CustomArray = [];
    is completely normal. I've seen it used in nearly all arrays I've seen in mods such as PropHunt.
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.6.1 *NEW* Windows 10 compatible!
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  6. #6
    edub18's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    Germany
    Posts
    146
    Reputation
    10
    Thanks
    12
    My Mood
    Bored
    Okay i used it this way now:
    Code:
    self thread maps\mp\gametypes\_hud_message::hintMessage(self.CustomArray[1]);
    I get no errors anymore but there is no Text displayed.

    //EDIT: Or is there any tutorial on how to use Arrays with GSC?
    Last edited by edub18; 09-04-2010 at 11:49 PM.

Similar Threads

  1. [Help] Help with arrays
    By kronus980 in forum Java
    Replies: 6
    Last Post: 06-23-2010, 01:43 PM
  2. Questions on arrays
    By origami7795 in forum C++/C Programming
    Replies: 3
    Last Post: 03-11-2010, 06:57 PM
  3. MultiLevel Arrays and Pointers
    By zeco in forum C++/C Programming
    Replies: 0
    Last Post: 10-07-2009, 08:31 PM
  4. Strings and chracter arrays
    By zeco in forum C++/C Programming
    Replies: 0
    Last Post: 08-04-2009, 03:14 PM
  5. [Tutorials]Array of Bytes
    By Str8Soulja00 in forum Visual Basic Programming
    Replies: 3
    Last Post: 01-02-2008, 01:52 AM