Raised This Month: $ Target: $400
 0% 

warning 209 when i definately returned a value


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xPwnage
New Member
Join Date: Jan 2014
Old 01-21-2014 , 21:47   warning 209 when i definately returned a value
Reply With Quote #1

Im getting this error warning 209: function "@ClassSkipLevel" should return a value even though i scripted it to do so this is what i mean:
Code:
public @ClassSkipLevel ( Client, Level, PowerLevel )
{
if ( Level == 0 )
{
return 2;
}
else
{
return 1;
}
}
Gives me the error, why?
So far the only way it won't give me the warning is when i do this:
Code:
public @ClassSkipLevel ( Client, Level, PowerLevel )
{
return 1;
}
also this will not work same error:
Code:
public @ClassSkipLevel ( Client, Level, PowerLevel )
{
if ( Powerlevel >= 1000000 )
{
switch ( Level )
{
case 0:
{
return 1;
}
}
}
else
{
return 0;
}
}
The game in question is Half-life Mod ESF + ECX and im trying to make a character Ascend past a level when having achieved a high enough powerlevel. The function @ClassSkipLevel will skip you to Level x if achieved powerlevel y.
So basically i should be able to do this not?:
Code:
public @ClassSkipLevel ( Client, Level, PowerLevel )
{
if ( Level == 0 && PowerLevel >= 1000000 )
{
return 2;
}
else if ( Level == 0 && PowerLevel >= 1500000 )
{
return 3;
}
else if ( PowerLevel < 800000 )
{
return 0;
}
else
{
return 1;
}
}
I know theres not many ESF players out there anymore but i figured since its pawn maybe people here could help me see what im missing. why is it giving me the error?
It uses amxx 1.76d and metamod 1.19p31
Quote:
Or is this just ECX's Core Compiler Interface Being a @#$% and should i try to use amxxpc?
stripe that.. CCI uses amxxpc

Last edited by xPwnage; 01-21-2014 at 21:59. Reason: Better title, some info added..
xPwnage is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 01-21-2014 , 23:16   Re: warning 209 when i definately returned a value
Reply With Quote #2

Add a return statement at the end of the function
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-22-2014 , 00:53   Re: warning 209 when i definately returned a value
Reply With Quote #3

PHP Code:
public @ClassSkipLevel ClientLevelPowerLevel )
{
    if ( 
Level == )
    {
        return 
2;
    }
    else
    {
        return 
1;
    }
    return 
1;

or better :

PHP Code:
public @ClassSkipLevel ClientLevelPowerLevel )
{
    if ( !
Level )
    {
        return 
2;
    }

    return 
1;

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 01-22-2014 at 00:54.
ConnorMcLeod is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-22-2014 , 03:08   Re: warning 209 when i definately returned a value
Reply With Quote #4

Or shorter yet:

PHP Code:

public @ClassSkipLevel ClientLevelPowerLevel )
{
    return (
Level 2);

__________________
fysiks is offline
xPwnage
New Member
Join Date: Jan 2014
Old 01-22-2014 , 08:52   Re: warning 209 when i definately returned a value
Reply With Quote #5

OMG it works! You are gods! Thanks ever so much ill get back to here with more trouble later for sure xD
Cheers!
xPwnage is offline
Reply



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 22:01.


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