Jump to content
MakeWebGames

Recommended Posts

Posted

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]."";
Posted

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].";
Posted

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.

Posted

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'];

Posted

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:

Posted

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. :-(

Posted

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.

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.   Paste as plain text instead

  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...