playMaker

Author Topic: Store Two Strings into one index array  (Read 662 times)

Budde88

  • Full Member
  • ***
  • Posts: 162
    • View Profile
Store Two Strings into one index array
« on: November 18, 2016, 10:18:56 AM »
Let me elaborate :)

We are registering players for our game.

I need to store these 2 separate string variables
-playerName
-playerResId

into one array so that

index = 1 is "bob" with avatar "avt34" for example.

Can anyone help me out?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4582
    • View Profile
    • jinxtergames
Re: Store Two Strings into one index array
« Reply #1 on: November 19, 2016, 12:35:06 AM »
Hi,
I would just use 2 arrays and use the index number the get both strings.
So one for 'playerName' and one for playerResId.

Else you could build the 2 strings together and use a separator ( | or - for example)
Then place it into the array and when you get the string you need to split the string again.

So 2 string into 1 array has a lot more steps to do...