Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-08-2011, 02:53 PM
PowerProNL PowerProNL is offline
Retired Zone Manager
PowerProNL's Avatar
Join Date: Feb 2008
Location: Holland
Posts: 266
PowerProNL can only hope to improve
Send a message via AIM to PowerProNL
Easy BMI Calculator with Feet/Pounds converter

Ok, I have decided to make my own BMI Converter.

The BMI Converter looks how fat u are. If your BMI is higher then 30 then you are way too fat if it's 24 you are healthy.

I tested it and it works very well!

Installation:
1. Create a weapon (name doesn't matter).
2. Copy and paste this script.
3. Give your self the weapon.
4. Fire the weapon (select the weapon and press D).
5. Have fun .

Feel free to use it anywere, share it doesn't matter. I did this for you .

PHP Code:
/*
This is made by PowerProNL. Feel free to use it, edit it. as long as I get the credits.
Don't edit this and say that you have made it because that is sad.
*/

//#CLIENTSIDE
function OpenBMI() {
  
BMI_Window1.show();
  new 
GuiWindowCtrl("BMI_Window1") {
    
profile GuiBlueWindowProfile;
    
clientrelative true;
    
clientextent "386,112";

    
canmaximize false;
    
canminimize true;
    
canmove true;
    
canresize false;
    
closequery false;
    
destroyonhide false;
    
text "BMI Calculator";
    
364;
    
372;

    new 
GuiButtonCtrl("BMI_Button1") {
      
profile GuiBlueButtonProfile;
      
height 25;
      
text "Calculate BMI";
      
width 229;
      
87;
    }
    new 
GuiButtonCtrl("BMI_Button2") {
      
profile GuiBlueButtonProfile;
      
height 57;
      
text "Feets to M ";
      
width 161;
      
227;
    }
    new 
GuiScrollCtrl("BMI_MultiLine1_Scroll") {
      
profile GuiBlueScrollProfile;
      
height 87;
      
hscrollbar "dynamic";
      
vscrollbar "dynamic";
      
width 227;

      new 
GuiMLTextCtrl("BMI_MultiLine1") {
        
profile GuiBlueMLTextProfile;
        
height 16;
        
horizsizing "width";
        
width 202;
      }
    }
    new 
GuiTextEditCtrl("BMI_TextEdit1") {
      
profile GuiBlueTextEditProfile;
      
height 20;
      
width 136;
      
89;
      
text "ex: 1.66";
      
8;
    }
    new 
GuiTextEditCtrl("BMI_TextEdit2") {
      
profile GuiBlueTextEditProfile;
      
height 20;
      
width 137;
      
89;
      
text "ex: 61";
      
42;
    }
    new 
GuiTextCtrl("BMI_Text1") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Your length in m";
      
width 84;
      
3;
      
7;
    }
    new 
GuiButtonCtrl("BMI_Button4") {
      
profile GuiBlueButtonProfile;
      
height 55;
      
text "Pound to KG";
      
width 159;
      
227;
      
57;
    }
    new 
GuiTextCtrl("BMI_Text2") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Your weight in kg";
      
width 85;
      
2;
      
40;
    }
    new 
GuiTextCtrl("BMI_Text3") {
      
profile GuiBlueTextProfile;
      
height 20;
      
width 8;
      
2;
      
64;
      
text "BMI:";
    }
  }
}

function 
BMI_Button1.onAction() {
  
this.cm BMI_TextEdit1.gettext();
  
this.kg BMI_TextEdit2.gettext();
  
this.cm1 this.cm this.cm;
  
this.bmi this.kg this.cm1;
  if (
this.bmi 18) {
    
BMI_Text3.text "BMI: "@int(this.bmi)@" = You have a too light weight.";
  }
  if (
this.bmi 18 && this.bmi 25) {
    
BMI_Text3.text "BMI: "@int(this.bmi)@" = You have a perfect weight.";
  }
  if (
this.bmi 25 && this.bmi 30) {
    
BMI_Text3.text "BMI: "@int(this.bmi)@" = You are fat.";
  }
  if (
this.bmi 30 && this.bmi 35) {
    
BMI_Text3.text "BMI: "@int(this.bmi)@" = You have Obesitas.";
  }
  if (
this.bmi 35) {
    
BMI_Text3.text "BMI: "@int(this.bmi)@" = You have Morbide Obesitas.";
  }
}

function 
BMI_Button2.onAction() {
  
this.cm BMI_TextEdit1.gettext();
  
this.cmm this.cm 0.3048;
  
BMI_TextEdit1.text this.cmm;
}

function 
BMI_Button4.onAction() {
  
this.kg BMI_TextEdit2.gettext();
  
this.kgg this.kg 2.2;
  
BMI_TextEdit2.text int(this.kgg);
}
function 
onWeaponFired() {
  if (!
BMI_Window1.visible) {
    
OpenBMI();
  } else {
    
BMI_Window1.destroy();
  }


Url to video (little preview): http://www.youtube.com/watch?v=g3vcalwc_b4
__________________
Graal Mail: [email protected]
McPowerProNL, I'm loving it
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:18 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.