Raised This Month: $ Target: $400
 0% 

FF2 Can't block rage?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 12-26-2015 , 06:58   Can't block rage?
Reply With Quote #1

Trying to make a rage not work in midair.

PHP Code:
public FF2_PreAbility(index, const String:plugin_name[], const String:ability_name[], slotstatus, &enabled)
{
    if(
plugin_name[0])
    {
        if(
strcmp(this_plugin_nameplugin_name))
        {
            return;
        }
    }
    
    if (!
strcmp(ability_name"rage_gugnir"))
    {
        new 
iBoss GetClientOfUserId(FF2_GetBossUserId(index));

        if (!
g_bHasGugnir[iBoss] || !IsClientInGame(iBoss) || !IsPlayerAlive(iBoss) || !(GetEntityFlags(iBoss) & FL_ONGROUND))
        {
            
enabled false;
            return;
        }
    }

    return;

I set enabled = false, but you can still mid-air rage and lose all your rage.
__________________

Last edited by Chdata; 12-26-2015 at 06:58.
Chdata is offline
93SHADoW
AlliedModders Donor
Join Date: Jul 2014
Location: Houston, TX
Old 12-26-2015 , 09:38   Re: Can't block rage?
Reply With Quote #2

Quote:
Originally Posted by Chdata View Post
Trying to make a rage not work in midair.

PHP Code:
public FF2_PreAbility(index, const String:plugin_name[], const String:ability_name[], slotstatus, &enabled)
{
    if(
plugin_name[0])
    {
        if(
strcmp(this_plugin_nameplugin_name))
        {
            return;
        }
    }
    
    if (!
strcmp(ability_name"rage_gugnir"))
    {
        new 
iBoss GetClientOfUserId(FF2_GetBossUserId(index));

        if (!
g_bHasGugnir[iBoss] || !IsClientInGame(iBoss) || !IsPlayerAlive(iBoss) || !(GetEntityFlags(iBoss) & FL_ONGROUND))
        {
            
enabled false;
            return;
        }
    }

    return;

I set enabled = false, but you can still mid-air rage and lose all your rage.
return Plugin_Changed?
__________________
93SHADoW is offline
Send a message via AIM to 93SHADoW Send a message via Skype™ to 93SHADoW
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 12-26-2015 , 10:06   Re: Can't block rage?
Reply With Quote #3

the function prototype doesn't support actions.
__________________
Chdata is offline
Wliu
Veteran Member
Join Date: Apr 2013
Old 12-26-2015 , 11:18   Re: Can't block rage?
Reply With Quote #4

Ok, I'll check this out.
__________________
~Wliu
Wliu is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 12-31-2015 , 05:18   Re: Can't block rage?
Reply With Quote #5

That forward has never been useful. Also you can not determine the order that forward is going to happen in each subplugin.
You could do something there though, where if they have ability x, you reduce their rage so the ability can't fire (not sure if there is a check between pre and post)
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 12-31-2015 , 05:56   Re: Can't block rage?
Reply With Quote #6

All I did is refund rage.
__________________
Chdata is offline
Wliu
Veteran Member
Join Date: Apr 2013
Old 12-31-2015 , 13:38   Re: Can't block rage?
Reply With Quote #7

From just looking through the code it looks like the enabled check should be working (it's a simple if(!enabled) return; statement). So I guess that means...are you sure you're reaching the enabled = false line?
__________________
~Wliu
Wliu is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 01-03-2016 , 05:01   Re: Can't block rage?
Reply With Quote #8

One of the biggest problems is how the buttons are handled and the charge mechanism.. Constantly it calls the onability forward, so that will cause some issues with canceling it.

I don't see why preability doesn't get changed to return an action so it can result in canceling the ability. So few plugins use that forward, it probably won't interfere...
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 01-03-2016 , 07:32   Re: Can't block rage?
Reply With Quote #9

Exactly what I was thinking.
__________________
Chdata 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 19:48.


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