Raised This Month: $ Target: $400
 0% 

[TF2] return function; (new syntax)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
StormishJustice
Member
Join Date: May 2015
Location: In a mysterious place.
Old 04-20-2016 , 06:47   Re: [TF2] return function; (new syntax)
Reply With Quote #4

Quote:
Originally Posted by Phil25 View Post
I'm not certain but I think not putting a type before the function will make it an int type. If you don't need to return anything, set it as void. But like ddhoward said, you should post your code.
Code:
void GetClassMaxHealth(int client)
{
    TFClassType class = TF2_GetPlayerClass(client);
    int Health;
    switch(class)
    {
        case TFClass_Scout: Health = 125;
        case TFClass_Soldier: Health = 200;
        case TFClass_Pyro: Health = 175;
        case TFClass_DemoMan: Health = 175;
        case TFClass_Heavy: Health = 300;
        case TFClass_Engineer: Health = 125;
        case TFClass_Medic: Health = 150;
        case TFClass_Sniper: Health = 125;
        case TFClass_Spy: Health = 125;
    }
    return Health;
}
This is just added into the new syntax (1.7), so don't try to use anything from the old syntax.
__________________
StormishJustice is offline
Send a message via AIM to StormishJustice Send a message via Yahoo to StormishJustice Send a message via Skype™ to StormishJustice
 


Thread Tools
Display Modes

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 -4. The time now is 21:12.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode