Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Guild System help.. (https://forums.graalonline.com/forums/showthread.php?t=79632)

Stryke 05-05-2008 01:37 AM

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?

Tigairius 05-05-2008 02:08 AM

Quote:

Originally Posted by Stryke (Post 1389123)
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 (Post 1389123)
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.)

Stryke 05-05-2008 02:20 AM

EDIT: Nevermind, thanks Tigairius. array.remove("Text"); works very well.
I was just overcomplicating the script by trying to script a custom array.remove.

Tigairius 05-05-2008 02:33 AM

Quote:

Originally Posted by Stryke (Post 1389127)
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 :p you're welcome.


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

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