View Single Post
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