Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Parteeeeee (https://forums.graalonline.com/forums/showthread.php?t=75592)

killerogue 07-17-2007 12:40 AM

Parteeeeee
 
PHP Code:

function onCreated() {
  
createParty({"James""John""Ky"});
  
onTimeout();
}

public function 
createParty(members) {
  
temp.keys getstringkeys("this.party");
  
temp.pindex keys.size();
  
  
makevar("this.party" pindex) = members;
  
setTimer(.05);
}

public function 
destroyParty() {
}

public function 
partyChecks() {
  if (
getstringkeys("this.party") != null)
    return 
true;
  else if (
getstringkeys("this.party") == null)
    return 
false;
}

public function 
playerInParty(acct) {
  for (
temp.party getstringkeys("this.party")) {
    if (
acct in makevar("this.party" party)) return {trueacct};
  }
  return {
falseacct};
}

public function 
addMember() {
}

public function 
removeMember() {
}

public function 
updateParties() {
  for (
temp.party getstringkeys("this.party")) {
    echo(
party);
    if (
this.(@ "party" party).size() <= 1) {
      echo(
"party has 1 or less member(s)");
    }
    else {
      echo(
"party has more than one member(s)");
    }
  }
}

function 
onTimeout() {
  if (
partyChecks() == true) {
    
updateParties();
    
setTimer(.05);
  }
  else
    return;


Party system I'm working on for a project. Was wondering why this also continuously insists upon echoing "Checks" when I echo party. :o


All times are GMT +2. The time now is 05:32 PM.

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