Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /////////////////////////////
- // Health Display Script //
- // 10/09/2013 - DD/MM/YYYY //
- // By LorenKPetrov //
- // Skype: LorenKadyPetrov //
- /////////////////////////////
- $PlayerHealth=100 // Changable variable to dev test IF statement working correctly - Remove when intergrating with database
- $PlayerDead="<font color='#FF0000'>Dead</font>";
- if($PlayerHealth <= 0) // States the player is dead if their health is 0 or less
- {
- echo $PlayerDead;
- }
- elseif($PlayerHealth <= 25) // States the player has 25 or less health
- {
- echo "<font color='#FF0000'>" . $PlayerHealth . "</font>";
- }
- elseif($PlayerHealth <= 50) // States the player has 50 or less health
- {
- echo "<font color='#FFB300'>" . $PlayerHealth . "</font>";
- }
- elseif($PlayerHealth <= 75) // States the player has 75 or less health
- {
- echo "<font color='#F6FF00'>" . $PlayerHealth . "</font>";
- }
- elseif($PlayerHealth >= 76) // States the player has 76 or more health - Good for giving players more than 100 health
- {
- echo "<font color='#00FF00'>" . $PlayerHealth . "</font>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement