Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-23-2006, 09:30 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
obj.remove()

Well, I have one problem: I have an array storing all the ammount of each weapon a player has, but removing an ammount is weirder then I thought,
example:

PHP Code:
function onCreated()
{
  
temp.arr = { 123123};
  
temp.arr.remove1);
  
  echo( 
temp.arr);

It removes the first 1 it finds ( 0), when I try to clear out the other 1 ( 3)
I've tried like temp.arr[ 3] = NULL; temp.arr[ 3].clear();

Anyone know the solution for this?
__________________
Reply With Quote
  #2  
Old 12-23-2006, 10:25 PM
Andy0687 Andy0687 is offline
Enigma
Join Date: Feb 2002
Posts: 1,072
Andy0687 is on a distinguished road
Quote:
Originally Posted by Chompy View Post
Well, I have one problem: I have an array storing all the ammount of each weapon a player has, but removing an ammount is weirder then I thought,
example:

PHP Code:
function onCreated()
{
  
temp.arr = { 123123};
  
temp.arr.remove1);
  
  echo( 
temp.arr);

It removes the first 1 it finds ( 0), when I try to clear out the other 1 ( 3)
I've tried like temp.arr[ 3] = NULL; temp.arr[ 3].clear();

Anyone know the solution for this?
Use .delete();

temp.arr.delete(index); to remove by index instead of object.
Reply With Quote
  #3  
Old 12-23-2006, 10:56 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by Andy0687 View Post
Use .delete();

temp.arr.delete(index); to remove by index instead of object.
Hmm, didn't think of that Thanks
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:42 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.