Jump to content

Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting T_PAAMAYIM_NE


andrew89898

Recommended Posts

Hey, Its something to do with the ' or \ I know that as Ive been trying alot.

Code

if ($this->isAdmin && count ($func_players) > SettingsManager::GetSetting(Settings::BAN_LIMIT))
 return $this->sendErrorBox('max', 'You can\'t ban that many Users at once!', 'Gosh', 'iBan');

      foreach($func_players as $func_player) $func_player->ban(&this->playerName, $this->isAdmin); 
  return $this->sendErrorBox('max', sprintf( 
  '%s ha%s been banned.'
  $this->getPlayerString($func_players),
   count($func_players) == 1 ? 's' : 've'),
   'SykoPwns:P', 'Sykos:iBan');

 

Thanks for your help! Ive tried alot of things I think I could just take out the \ or something!!

Link to comment
Share on other sites

OK Here's a bigger piece of code (the previous function included as its almost identical) I've been comparing them and they are pretty much the same apart from the odd word... and that the first one does compile!

public function kickPlayer($func_player) {
      $func_players = $this->getPlayers($func_player);


      
     if($this->isAdmin && count($func_players) > SettingsManager::GetSetting(Settings::KICK_LIMIT))
      return $this->sendErrorBox('max', 'You can\'t kick that many Users at once!', 'Damn', 'iKick');
      
      foreach($func_players as $func_player) $func_player->kick($this->playerName, $this->isAdmin);
      return $this->sendErrorBox('max', sprintf(
        '%s ha%s been kicked.',
        $this->getPlayerString($func_players),
        count($func_players) == 1 ? 's' : 've'),
     'SykoPWNS:P', 'Sykos:iKick');
    }


public function banPlayer ($func_player) {
  $func_players = $this->getPlayers($func_player);
    
if ($this->isAdmin && count ($func_players) > SettingsManager::GetSetting(Settings::BAN_LIMIT))
 return $this->sendErrorBox('max', 'You can\'t ban that many Users at once!', 'Gosh', 'iBan');

      (line 675)foreach($func_players as $func_player) $func_player->ban(&this->playerName, $this->isAdmin); 
  return $this->sendErrorBox('max', sprintf(
  '%s ha%s been banned.',
  $this->getPlayerString($func_players),
   count($func_players) == 1 ? 's' : 've'),
   'SykoPwns:P', 'Sykos:iBan');
}

The compiler says the error is on line 675 ^^

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.