Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-05-2008, 01:37 AM
Stryke Stryke is offline
Scripter
Join Date: Apr 2008
Posts: 157
Stryke is an unknown quantity at this point
Guild System help..

NPC Code:
this.count = 0;
for(i=0;i<serverr.guild_total;i++ {
if(i>(params[1]+this.count)) {
serverr.guild_list[i-1] = serverr.guild_list[i];
this.count += 1;
}
}

params[1] is GA_List.getselectedrow()


This wont work. Anyone know a way to remove a string from a string array, then sorting them back together so they won't leave a gap from where the string that was removed was?
Reply With Quote
  #2  
Old 05-05-2008, 02:08 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by Stryke View Post
This wont work. Anyone know a way to remove a string from a string array, then sorting them back together so they won't leave a gap from where the string that was removed was?
Yes, array.remove("text");


Quote:
Originally Posted by Stryke View Post
NPC Code:
this.count = 0;
for(i=0;i<serverr.guild_total;i++ {
if(i>(params[1]+this.count)) {
serverr.guild_list[i-1] = serverr.guild_list[i];
this.count += 1;
}
}

params[1] is GA_List.getselectedrow()

Try something like this:
PHP Code:
for(0temp.count = -1serverr.guild_totali++, temp.count ++) {
  if (
> (params[1] + count)) {
    
serverr.guild_list.remove(serverr.guild_list[i]);
  }

(May be very inaccurate to what you're trying to do, but you didn't give enough details.)
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #3  
Old 05-05-2008, 02:20 AM
Stryke Stryke is offline
Scripter
Join Date: Apr 2008
Posts: 157
Stryke is an unknown quantity at this point
EDIT: Nevermind, thanks Tigairius. array.remove("Text"); works very well.
I was just overcomplicating the script by trying to script a custom array.remove.
Reply With Quote
  #4  
Old 05-05-2008, 02:33 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by Stryke View Post
EDIT: Nevermind, thanks Tigairius. array.remove("Text"); works very well.
I was just overcomplicating the script by trying to script a custom array.remove.
Oh you're welcome.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 08:09 PM.


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