Thread: Script Help.
View Single Post
  #1  
Old 02-28-2015, 03:54 PM
Kirko Kirko is offline
Registered Guest
Join Date: Dec 2014
Location: Texas
Posts: 61
Kirko has a spectacular aura aboutKirko has a spectacular aura about
Script Help.

Why doesn't this script remove the player from the array? What I'm trying to do is get the list of members in a guild then remove the player that is said. Everything works but the removing of the player. The player I'm trying to remove is "Test".

PHP Code:
function ContinueToRemove(memberguild){
  
temp.test NULL;
  
/*temp.remove = format(
    "UPDATE Guilds" NL
    " SET Members = REPLACE(Members, '%s', NULL)" NL
    "  WHERE Name = '%s'",
    temp.member, temp.guild
  );*/

  
temp.remove format(
    
"UPDATE Guilds" NL
    
" SET Members = '%s'" NL
    
"  WHERE Name = '%s'",
    
temp.testtemp.guild
  
);
  
//temp.req = requestSQL(temp.remove, false);
  
  
for(temp.i=0temp.GetMembers(temp.guild).size(); temp.i++){
    
temp.test.add(GetMembers(temp.guild)[i]);
    echo(
"Created Array" SPC temp.i SPC ":" SPC temp.test);
  }
  for(
temp.n=0temp.temp.test.size(); temp.n++){
    if(
temp.test[n] == temp.member){
      echo(
"Remove:" SPC temp.test[n]);
      echo(
"From:" SPC temp.test);
      echo(
"New Array:" SPC temp.test.delete(n));//isnt working
    
}
  }
  echo(
"------------------------------");

I also tried doing remove instead of delete and still didn't work

this is what echos into rc.
[12:39] ------------------------------
[12:39] Updated Array: Graal1341684,
[12:39] Updated Array: Graal1341684,Holder
[12:39] Updated Array: Graal1341684,Holder,Test
[12:39] Updated Array: Graal1341684,Holder,Test,Holder2
[12:39] Remove: Test
[12:39] From: Graal1341684,Holder,Test,Holder2
[12:39] New Array: 0
[12:39] ------------------------------
Reply With Quote