Raised This Month: $51 Target: $400
 12% 

No Clip - Stuck


Post New Thread Reply   
 
Thread Tools Display Modes
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-26-2009 , 17:27   Re: No Clip - Stuck
Reply With Quote #11

PHP Code:
    set_user_noclipplrget_user_noclipplr ) ? ); 
Why not:
PHP Code:
    set_user_noclipplr, !get_user_noclipplr ) ); 
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-27-2009 , 05:04   Re: No Clip - Stuck
Reply With Quote #12

This seems to work :
PHP Code:
/*    Formatright © 2009, ConnorMcLeod

    NoClip is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with NoClip; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
#include <engine>
#include <fun>
#include <hamsandwich>

#define VERSION "0.0.1"

#define MAX_PLAYERS    32

enum {
    
NoClipNone,
    
NoClipRemove,
    
NoClipSet
}

const 
IN_SOLID_AREA    = (1<<TR_StartSolid)

new 
g_iNoClip[MAX_PLAYERS+1]

public 
plugin_init()
{
    
register_plugin("NoClip"VERSION"ConnorMcLeod")

    
RegisterHam(Ham_Spawn"player""Player_Spawn_Post"1)
    
RegisterHam(Ham_Killed"player""Player_Killed_Post"1)

    
register_clcmd("+noclip""ClientCommand_NoClipOn")
    
register_clcmd("-noclip""ClientCommand_NoClipOff")
}

public 
Player_Spawn_Postid )
{
    if( 
is_user_aliveid ) )
    {
        
g_iNoClip[id] = NoClipNone
    
}
}

public 
Player_Killed_Postid )
{
    
g_iNoClip[id] = NoClipNone
}

public 
ClientCommand_NoClipOnid )
{
    if( 
g_iNoClip[id] != NoClipSet && is_user_alive(id) )
    {
        
set_user_noclip(id1)
        
g_iNoClip[id] = NoClipSet
        client_print
(idprint_chat" ** NoClip ON")
    }
    return 
PLUGIN_HANDLED_MAIN
}

public 
ClientCommand_NoClipOffid )
{
    if( 
g_iNoClip[id] == NoClipSet && is_user_alive(id) )
    {
        
g_iNoClip[id] = NoClipRemove
        client_print
(idprint_chat" ** NoClip On Removal")
    }
    return 
PLUGIN_HANDLED_MAIN
}

public 
client_PreThinkid )
{
    if( 
g_iNoClip[id] == NoClipRemove && is_user_alive(id) )
    {
        static 
Float:vecOrigin[3]
        
entity_get_vector(idEV_VEC_originvecOrigin)
        if( !(
trace_hull(vecOriginentity_get_int(idEV_INT_flags) & FL_DUCKING HULL_HEAD HULL_HUMANid) & IN_SOLID_AREA) )
        {
            
set_user_noclip(id0)
            
g_iNoClip[id] = NoClipNone
            client_print
(idprint_chat" ** NoClip Off")
        }
    }

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Scherzo
Senior Member
Join Date: Feb 2007
Location: Kwidzyn, Poland
Old 07-27-2009 , 07:34   Re: No Clip - Stuck
Reply With Quote #13

omg i give you simple, engfunc() free way to check it, but you must post your own to prove "I can do it with different method", this with prethink added is the best for me

bravo
Scherzo is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-27-2009 , 09:41   Re: No Clip - Stuck
Reply With Quote #14

The code you provided just sucks.
The code i made just check the best time to remove player noclip, it's just an example, but works fine.
trace_hull method just works fine, feel free to use it or not.

Best regards.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
SchlumPF*
Veteran Member
Join Date: Mar 2007
Old 07-27-2009 , 09:48   Re: No Clip - Stuck
Reply With Quote #15

Quote:
Originally Posted by Scherzo View Post
omg i give you simple, engfunc() free way to check it, but you must post your own to prove "I can do it with different method", this with prethink added is the best for me

bravo
omg we post improvements, TraceHull way to check it (more efficient then you did or do now) and youre crying.
i just posted the idea about using tracehull which works great and connor put it in an working plugin, kkthxbye.

(this is the code snippets/ tutorials forum which means ppl SHOULD look at the codes and write suggestions etc to have perfect examples here)
__________________
SchlumPF* is offline
Send a message via ICQ to SchlumPF*
Scherzo
Senior Member
Join Date: Feb 2007
Location: Kwidzyn, Poland
Old 07-27-2009 , 10:31   Re: No Clip - Stuck
Reply With Quote #16

if tested and don`t work just remove it and replace with your, any my word more there
Scherzo 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 17:20.


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