Author Topic: [Answered] How to remove entry's from array  (Read 1117 times)

0 Members and 1 Guest are viewing this topic.

Offline spkka

  • Camper
  • ***
  • Posts: 469
[Answered] How to remove entry's from array
« on: July 02, 2007, 08:40:09 pm »
really couldn´t find how to do this properly:

remove an entry from the array and

greetz  :-[
« Last Edit: July 04, 2007, 09:23:12 am by spkka »

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: How to remove entry's from array
« Reply #1 on: July 03, 2007, 06:38:13 am »
SetArrayLength(ExampleArray,GetArrayLength(ExampleArray)-1);

this removes the last element of an array, if that is what you are talking about.
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline spkka

  • Camper
  • ***
  • Posts: 469
Re: How to remove entry's from array
« Reply #2 on: July 04, 2007, 06:49:47 am »
thnx, now lets say my file is like this:

Spkka
password
ip
0
0
0
0


the first 0 is the totalkills that player made... Now im keeping track of the total kills for that player in  array In Game...
But now this problem i want to clear that array (the first 0) so i can write in a new score


Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: How to remove entry's from array
« Reply #3 on: July 04, 2007, 07:16:29 am »
Erm... Why dont you just do MyArray[3] := '';

Offline spkka

  • Camper
  • ***
  • Posts: 469
Re: How to remove entry's from array
« Reply #4 on: July 04, 2007, 09:21:41 am »
thnx enesce!

Offline zyxstand

  • Veteran
  • *****
  • Posts: 1106
  • Mother of all Bombs
Re: [Answered] How to remove entry's from array
« Reply #5 on: July 04, 2007, 10:50:57 am »
Also, be sure to write to your file only like when the map changes or a player leaves.
Can't think of anything original to put here...