andrew89898 Posted January 24, 2011 Share Posted January 24, 2011 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!! Quote Link to comment https://forums.phpfreaks.com/topic/225520-parse-error-syntax-error-unexpected-t_object_operator-expecting-t_paamayim_ne/ Share on other sites More sharing options...
Maq Posted January 24, 2011 Share Posted January 24, 2011 I think you meant for this line to be: sprintf('%s ha%s been banned ' . not: sprintf('%s ha%s been banned.' Quote Link to comment https://forums.phpfreaks.com/topic/225520-parse-error-syntax-error-unexpected-t_object_operator-expecting-t_paamayim_ne/#findComment-1164510 Share on other sites More sharing options...
andrew89898 Posted January 24, 2011 Author Share Posted January 24, 2011 I just did that, Still same error Quote Link to comment https://forums.phpfreaks.com/topic/225520-parse-error-syntax-error-unexpected-t_object_operator-expecting-t_paamayim_ne/#findComment-1164512 Share on other sites More sharing options...
andrew89898 Posted January 24, 2011 Author Share Posted January 24, 2011 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 ^^ Quote Link to comment https://forums.phpfreaks.com/topic/225520-parse-error-syntax-error-unexpected-t_object_operator-expecting-t_paamayim_ne/#findComment-1164529 Share on other sites More sharing options...
Maq Posted January 24, 2011 Share Posted January 24, 2011 You're changing the code, at first you didn't have the comma, now you have: '%s ha%s been kicked.', Are you sure this is your current code? Quote Link to comment https://forums.phpfreaks.com/topic/225520-parse-error-syntax-error-unexpected-t_object_operator-expecting-t_paamayim_ne/#findComment-1164535 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.