Raised This Month: $ Target: $400
 0% 

two plugins with one velocity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Miko000000
Senior Member
Join Date: Jul 2008
Location: Slovakia
Old 01-31-2013 , 00:51   two plugins with one velocity
Reply With Quote #1

Hello. Im working on my own jailbreak plugin. But i have one problem. See code
There is part of prethink. All is good working but when player buy both (multijump,bhop) somethink went wrong. Is there any way how solve this problem ?
Code:
public client_PreThink(id)
{
    if(g_bhop == true)
    {
        set_pev(id, pev_fuser2, 0.0)
        if(pev(id, pev_button) & 2)
        {
        new flags = pev(id, pev_flags)
        
        if(flags & FL_WATERJUMP)
         return PLUGIN_CONTINUE
        if(pev(id, pev_waterlevel) >= 2)
        return PLUGIN_CONTINUE
        if(!(flags & FL_ONGROUND))
        return PLUGIN_CONTINUE
        
        new Float:velocity[3]
        pev(id, pev_velocity, velocity)
        velocity[2] += 260.0
        set_pev(id, pev_velocity, velocity)
        set_pev(id, pev_gaitsequence, 6)
        }  
    }
    if(g_multijump == true) 
    {
        if(!is_user_alive(id)) return PLUGIN_CONTINUE
        if(!(get_user_flags( id ) &  ADMIN_ADMIN)) return PLUGIN_CONTINUE
        new nbut = get_user_button(id)
        new obut = get_user_oldbutton(id)
        if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
        {
            if(jumpnum[id] < 1)
            {
                dojump[id] = true
                jumpnum[id]++
                return PLUGIN_CONTINUE
            }
        }
        if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
        {
            jumpnum[id] = 0
            return PLUGIN_CONTINUE
        }
    }
    return PLUGIN_CONTINUE
}    


public client_PostThink(id)
{
    if(g_multijump == true) 
    {
    if(!is_user_alive(id)) return PLUGIN_CONTINUE
    if(!(get_user_flags( id ) & ACCESS_ADMIN)) return PLUGIN_CONTINUE
    if(dojump[id] == true)
    {
        new Float:velocity[3]    
        entity_get_vector(id,EV_VEC_velocity,velocity)
        velocity[2] = random_float(265.0,285.0)
        entity_set_vector(id,EV_VEC_velocity,velocity)
        dojump[id] = false
        return PLUGIN_CONTINUE
    }
    }
    return PLUGIN_CONTINUE
}

Last edited by Miko000000; 01-31-2013 at 00:53. Reason: forget to add code
Miko000000 is offline
Send a message via ICQ to Miko000000 Send a message via Skype™ to Miko000000
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 01-31-2013 , 12:08   Re: two plugins with one velocity
Reply With Quote #2

try this:
Code:
public client_PreThink(id) {     if(g_multijump == true)     {         if(!is_user_alive(id)) return PLUGIN_CONTINUE         if(!(get_user_flags( id ) &  ADMIN_ADMIN)) return PLUGIN_CONTINUE         new nbut = get_user_button(id)         new obut = get_user_oldbutton(id)         if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))         {             if(jumpnum[id] < 1)             {                 dojump[id] = true                 jumpnum[id]++                 return PLUGIN_CONTINUE             }         }         if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))         {             jumpnum[id] = 0         }     }     if(g_bhop == true)     {         set_pev(id, pev_fuser2, 0.0)         if(pev(id, pev_button) & 2)         {         new flags = pev(id, pev_flags)                 if(flags & FL_WATERJUMP)          return PLUGIN_CONTINUE         if(pev(id, pev_waterlevel) >= 2)         return PLUGIN_CONTINUE         if(!(flags & FL_ONGROUND))         return PLUGIN_CONTINUE                 new Float:velocity[3]         pev(id, pev_velocity, velocity)         velocity[2] += 260.0         set_pev(id, pev_velocity, velocity)         set_pev(id, pev_gaitsequence, 6)         }       }     return PLUGIN_CONTINUE }

Last edited by jimaway; 01-31-2013 at 12:12.
jimaway is offline
Miko000000
Senior Member
Join Date: Jul 2008
Location: Slovakia
Old 01-31-2013 , 16:25   Re: two plugins with one velocity
Reply With Quote #3

Thank you very much. All is working !
Miko000000 is offline
Send a message via ICQ to Miko000000 Send a message via Skype™ to Miko000000
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 20:38.


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