Jump to content
MakeWebGames

Recommended Posts

Posted

I have only just started coding for gl engine and its still quite new to me 

I have been building a paid module (Boss Fights) i have all the code set up and attack functions are working properly there is a slight issue when im trying to display the last 10 hits in mccodes would be easy buy this i dont fully understand yet 

So basiclly i want it to display something like this

<th>User</th>

<th>Damage done</th>

Then under the user the users name and under damage done i want it to say there damage but now i get it like this

image.thumb.png.7143c202826e9161d11fb6b7d6deed1e.png

  • Like 1
Posted (edited)

You want something like this...

<table>
  <tr>
    <th>User</th>
    <th>Damage Done</th>
  </tr>
  <?php 
     // code to loop rows 
	$hits = count($action);
	while($x <= $hits) {
		echo "<tr>";
		echo "<td>$action['user']</td>";
		echo "<td>$action['damage']</td>";
		echo "</tr>";
		$x++;
	}
  ?>
</table>
  

 

Edited by TonyCisseroni
  • Like 1
Posted (edited)
<table>
  <thead>
  	<tr>
    	<th>User</th>
        <th>Damage</th>
     </tr>
 	</thead>
  	<tbody>
      {#each hits}
      	<tr>
          <td>{>userName}</td>
          <td>{damage} Damage</td>
      	</tr>
      {/each}
  </tbody>
</table>

You could do somrthing like this in the tpl.php file

Edited by Dayo
  • Like 3
Posted (edited)
14 hours ago, Dayo said:

<table> <thead> <tr> <th>User</th> <th>Damage</th> </tr> </thead> <tbody> {#each hits} <tr> <td>{>userName}</td> <td>{damage} Damage</td> </tr> {/each} </tbody> </table>


<table>
  <thead>
  	<tr>
    	<th>User</th>
        <th>Damage</th>
     </tr>
 	</thead>
  	<tbody>
      {#each hits}
      	<tr>
          <td>{>userName}</td>
          <td>{damage} Damage</td>
      	</tr>
      {/each}
  </tbody>
</table>

You could do somrthing like this in the tpl.php file

Thanks Dayo this is what i need exactly 

Thank you to everyone for your answers but gangsters legends styling is a little different which im still getting used to 

Edited by SwiftGameR

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