Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   find player attribute for allplayers (https://forums.graalonline.com/forums/showthread.php?t=134260104)

sssssssssss 08-07-2010 09:44 PM

find player attribute for allplayers
 
I have this:

PHP Code:

function onActionServerSide() {
  if (
params[0] == "loadPTList") {
    for (
plallplayers) {
      if (
findplayer(pl).attr[5]) {
        
temp.searching_list.add(findplayer(pl));
        
triggerClient("gui"name"sendList");
      }
    }
  }


I tested and the serverside is getting triggered up until the if command. What I'm obviously trying to do is if the player.attr[5] for all players on at that time are true, to add them to a temp.array, but its not, its stopping at the if command, and mine, at least in testing, is true.

cbk1994 08-07-2010 10:09 PM

allplayers is an array of player objects, not account names.

PHP Code:

function onActionServerSide() { 
  if (
params[0] == "loadPTList") { 
    
temp.searching_list null;
    for (
temp.plallplayers) { 
      if (
pl.attr[5]) { 
        
searching_list.add(pl.account);
      } 
    }
    
    
triggerClient("gui"name"sendList"searching_list); 
  } 




All times are GMT +2. The time now is 03:12 PM.

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