Raised This Month: $ Target: $400
 0% 

eW | Variable isn't returning function ( switch case ).


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
iBrazilian
Senior Member
Join Date: May 2011
Old 07-25-2013 , 07:17   eW | Variable isn't returning function ( switch case ).
Reply With Quote #1

I've currently got two files, skill.inl which calls the function and bug.inl which the function is currently loaded there.
The issue I'm having is that new SKILL:iSkillReturn isn't returning any values at all, I'm not sure why, I've spend quite some time and I resort to forum helpers.

Do I need to do anything else with SKILL:Absorb(id, skill, prop)?

SKILL.INL:
Code:
#include "bug.inl"

enum
{
    SKILL_1,
    SKILL_2,
};

stock DelayedCallSkill(Float:time, id, skill, prop)
{
    new parm[3];
    parm[0] = id;
    parm[1] = skill;
    parm[2] = prop;
    set_task(time, "task_CallSkill", SKILLCALL_TASK + (skill * MAX_PLAYERS) + id, parm, 3);
}

public task_CallSkill( parm[] ){
    CallSkill( parm[0], parm[1], parm[2] );
}

CallSkill(id, skill, prop)
{
    new SKILL:iSkillReturn;
    switch(skill)
    {
        case SKILL_1:            iSkillReturn = Absorb(id, skill, prop);
        case SKILL_2:            iSkillReturn = Acid(id, skill, prop);
    } 
    
    if ( ValidPlayer(id) )
    {    
        switch ( iSkillReturn ) 
        {
            case SKILL_USED, SKILL_READY:
            {
                if( prop & SI_BIND )
                    bind_used( id, skill );
                else {
                    #if ONE_SKILL_USE == 0
                    parm[0] = id;
                    parm[1] = skill;
                    set_task(0.0, "delayed_bind_used", 0, parm, 2);
                    #else
                    bind_used( id, skill );
                    #endif
                }
            }
        }
    }
    return iSkillReturn;
}
BUG.INL:
Code:
SKILL:Absorb(id, skill, prop)
{
    new victim = PokeSkillTarget(id)

    if( !ValidPlayer(victim) || !Pokemod_Alive(victim) )
        return SKILL_READY;

    new armor = get_user_armor(victim)
    new level = SkillLevel(id, skill)
    new totake = (armor*level)/(TotalLevels+1)

    if(level < armor)
        clamp(totake, level, armor)
    else
        totake = armor

    Pokemod_Repair(id, totake)
    set_user_armor(victim, armor-totake)

    sound_hit(id)
    sound_hit(victim)

    MakeLine_Ent(0,id,victim,SPRITE_INDEX[SPR_ROPE],1,1,10,5,10,0,255,200,255,0)
    return SKILL_USED;
}
__________________
Pokemod Season 5 [ |||||||||| Complete]

Last edited by iBrazilian; 07-25-2013 at 07:31.
iBrazilian is offline
 



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 06:21.


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