Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Shows how much health you have.
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#5
RE: Shows how much health you have.

There may be a way to convert the integer generated by GetPlayerHealth into a string usable with the SetMessage function so you don't literally have to write it out 100 times. I did some research, but I'm not all that familiar with complicated programming, so you can take a look yourself:

PHP Code: (Select All)
string convertInt(int number)
{
   
stringstream ss;//create a stringstream
   
ss << number;//add number to the stream
   
return ss.str();//return a string with the contents of the stream


PHP Code: (Select All)
string convertInt(int number)
{
    if (
number == 0)
        return 
"0";
    
string temp="";
    
string returnvalue="";
    while (
number>0)
    {
        
temp+=number%10+48;
        
number/=10;
    }
    for (
int i=0;i<temp.length();i++)
        
returnvalue+=temp[temp.length()-i-1];
    return 
returnvalue;


08-23-2012, 09:51 AM
Find


Messages In This Thread
Shows how much health you have. - by onv - 08-22-2012, 10:12 PM
RE: Shows how much health you have. - by Melvin - 08-22-2012, 10:51 PM
RE: Shows how much health you have. - by Adny - 08-22-2012, 11:05 PM
RE: Shows how much health you have. - by Robby - 08-23-2012, 09:37 AM
RE: Shows how much health you have. - by Damascus - 08-23-2012, 09:51 AM



Users browsing this thread: 1 Guest(s)