- Joined
- Oct 20, 2013
- Messages
- 1
- Reaction score
- 0
Can someone give me the fix for the NPC for dboors?
It works but if i m using it with more than 1,000,000,000,000,000 resources it gives me the value 0 back , my server is pretty fast so i need it to work.
It works but if i m using it with more than 1,000,000,000,000,000 resources it gives me the value 0 back , my server is pretty fast so i need it to work.
PHP:
<?function getNextLink() { $text = '»'; if ($this->pageIndex + 1 == $this->pageCount) { return $text; } $link = ''; if (0 < $this->selectedTabIndex) { $link .= 't=' . $this->selectedTabIndex; } if ($link != '') { $link .= '&'; } $link .= 'p=' . ($this->pageIndex + 1); $link = 'build.php?id=' . $this->buildingIndex . '&' . $link; return '<a href="' . $link . '">' . $text . '</a>'; } function getPreviousLink() { $text = '«'; if ($this->pageIndex == 0) { return $text; } $link = ''; if (0 < $this->selectedTabIndex) { $link .= 't=' . $this->selectedTabIndex; } if (1 < $this->pageIndex) { if ($link != '') { $link .= '&'; } $link .= 'p=' . ($this->pageIndex - 1); } $link = 'build.php?id=' . $this->buildingIndex . '&' . $link; return '<a href="' . $link . '">' . $text . '</a>'; } function getResourceGoldExchange ($neededResources, $itemId, $buildingIndex, $multiple = FALSE) { if ( ( ($this->data['gold_num'] < $this->gameMetadata['plusTable'][6]['cost']) || ($this->isResourcesAvailable ($neededResources) && !$multiple))) { return ''; } $s1 = 0; $s2 = 0; $exchangeResource = ''; foreach ($neededResources as $k => $v) { $s1 += $v; $s2 += $this->resources[$k]['current_value']; if ($exchangeResource != '') { $exchangeResource .= '&'; } $exchangeResource .= 'r' . $k . '=' . $v; } $canExchange = $s1 <= $s2; if ( ($multiple && $canExchange)) { $num = floor ($s2 / $s1); $exchangeResource = ''; foreach ($neededResources as $k => $v) { if ($exchangeResource != '') { $exchangeResource .= '&'; } $exchangeResource .= 'r' . $k . '=' . $v * $num; } } return '<a href="build.php?bid=17&t=3&rid=' . $buildingIndex . '&' . $exchangeResource . '">[NPC]</a>'; }}$p = new GPage();$p->run();?>