RedZone Posted March 22, 2009 Posted March 22, 2009 Okay, so I'm changing a crap load of stuff on Mccodes V2. I got my gang tag color working and I'm trying to get it to show up in the hospital by the person who attacked them. This is what I use in every other part but for some reason I'm not sure why its not working in attack.php. I get this ERROR: "Parse error: syntax error, unexpected T_IF in /home/GAMER/public_html/attack.php on line 334" Line 334 is $hospreason = "Attacked by " if($theirhp <= 0){ // attacker won $winner = $user_class['ID']; $_SESSION['count']=0; $theirhp = 0; $moneywon = floor($attack_person['money'] /10); $expwon = 150 - (25 * ($user_class['level'] - $attack_person['level'])); $expwon = ($expwon < 0) ? 0 : $expwon; $hosptime=20; $hospreason = "Attacked by ".if($r['gang']) { print "[url='gangs.php?action=view&ID={$r['][<font color='{$r['gangCOLOR']}'>{$r['gangPREF']}</font>][/url]"; } print "[url='viewuser.php?u={$r['] {$r['username']}[/url].""; Quote
DELETE ME NOW! Posted March 22, 2009 Posted March 22, 2009 Re: Attack.php $hospreason = "Attacked by ".if($r['gang']) { print "[<font color={$r['gangCOLOR]}'>{$r['gangPREF']}</font>]"; } print " {$r['username']}.""; Check again... you will see the error ;) Quote
RedZone Posted March 22, 2009 Author Posted March 22, 2009 Re: Attack.php No I still don't see it. :? :? Quote
Mafia-Club Posted March 22, 2009 Posted March 22, 2009 Re: Attack.php Change print " {$r['username']}.""; To print " {$r['username']}."; Quote
RedZone Posted March 22, 2009 Author Posted March 22, 2009 Re: Attack.php Nope still same error.. "Parse error: syntax error, unexpected T_IF in /home/marfiaga/public_html/attack.php on line 334" $hospreason = "Attacked by ".if($r['gang']) { print "[url='gangs.php?action=view&ID={$r['][<font color='{$r['gangCOLOR']}'>{$r['gangPREF']}</font>][/url]"; } print "[url='viewuser.php?u={$r['] {$r['username']}[/url]."; Quote
DELETE ME NOW! Posted March 22, 2009 Posted March 22, 2009 Re: Attack.php Nope still same error.. "Parse error: syntax error, unexpected T_IF in /home/marfiaga/public_html/attack.php on line 334" $hospreason = "Attacked by ".if($r['gang']) { print "[url='gangs.php?action=view&ID={$r['][<font color='{$r['gangCOLOR']}'>{$r['gangPREF']}</font>][/url]"; } print "[url='viewuser.php?u={$r['] {$r['username']}[/url]."; Look after attacked by.. should be somethin like $hospreason = "Attacked by "; if($r['gang']) { print "[<font color={$r['gangCOLOR]}'>{$r['gangPREF']}</font>]"; } print " {$r['username'}."; Something like that. Quote
RedZone Posted March 22, 2009 Author Posted March 22, 2009 Re: Attack.php Now I'm getting: "Parse error: syntax error, unexpected '}', expecting ']' in /home/marfiaga/public_html/attack.php on line 340" On this line... print " {$r['username'}."; Quote
RedZone Posted March 22, 2009 Author Posted March 22, 2009 Re: Attack.php I checked 3 times 340 is that line. Do you wanna see the whole attack.php file? Here's what I got so far.. From like 325 to 343. if($theirhp <= 0){ // attacker won $winner = $user_class['ID']; $_SESSION['count']=0; $theirhp = 0; $moneywon = floor($attack_person['money'] /10); $expwon = 150 - (25 * ($user_class['level'] - $attack_person['level'])); $expwon = ($expwon < 0) ? 0 : $expwon; $hosptime=20; $hospreason = "Attacked by "; if($r['gang']) { print "[<font color={$r['gangCOLOR]}'>{$r['gangPREF']}</font>]"; } print " {$r['username'}"; $newexp = $expwon + $user_class['exp']; Quote
AlabamaHit Posted March 23, 2009 Posted March 23, 2009 Re: Attack.php print "[url='viewuser.php?u={$r['] {$r['username'}[/url]."; You just missed a ] in there. change that line to.. print "[url='viewuser.php?u={$r['] {$r['username']}[/url]."; And your good to go :wink: Quote
RedZone Posted March 23, 2009 Author Posted March 23, 2009 Re: Attack.php YAY! :-D It worked, BUT when you look in the hospital it says. " rscott4581 Attacked by 19" So it doesnt show who it was attacked by. :-( Quote
AlabamaHit Posted March 23, 2009 Posted March 23, 2009 Re: Attack.php thats all in what you did after attack not the attack.php check the attackwon.php, attacklost.php, attackleave.php etc.... look for hospital reason. That's what you need ot change to show the right thing. Quote
RedZone Posted March 23, 2009 Author Posted March 23, 2009 Re: Attack.php But isn't that the attack.php part? Cause this puts in $hospreason = "Attacked by "; into the SQL so it shows there.... right? Quote
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.