Raised This Month: $ Target: $400
 0% 

no clip + god mod


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Pelita Jaya F.C
Member
Join Date: Oct 2011
Location: Bangkok
Old 12-07-2011 , 01:36   no clip + god mod
Reply With Quote #1

Hi all! yes it's me

I need help . Why my code didn't cant be use , when i typr the cmd i cant walk throuhg wall or be on god mod.

please help

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <fun>

#define PLUGIN "No clip + Godm mod"
#define VERSION "0,1"
#define AUTHOR "pelita jaya f.v"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /clip""noclip_godmod") }

public 
noclip_godmod(id) {
    if ( 
is_user_alive(id) ) {
        
set_user_noclip(id1)
        
set_user_godmode(id1) }
    } 
p
__________________


My Plugins:
Power M4A1
Pelita Jaya F.C is offline
Pelita Jaya F.C
Member
Join Date: Oct 2011
Location: Bangkok
Old 12-07-2011 , 03:52   Re: no clip + god mod
Reply With Quote #2

bump!
__________________


My Plugins:
Power M4A1
Pelita Jaya F.C is offline
Erox902
Veteran Member
Join Date: Jun 2009
Location: Never Never Land
Old 12-07-2011 , 04:01   Re: no clip + god mod
Reply With Quote #3

There is nothing wrong with the code.
Compile and replace it once more just to be sure.
( If even that fails try deleting all other 3rd party plugins from your plugins.ini )

And do not bump until 15 days have passed! ( Not 2 hours! )
Erox902 is offline
Pelita Jaya F.C
Member
Join Date: Oct 2011
Location: Bangkok
Old 12-07-2011 , 06:47   Re: no clip + god mod
Reply With Quote #4

but why the native cannot be used?
when i type the command , I can't go through wall or be on god mod.
is the anythign worng?
__________________


My Plugins:
Power M4A1
Pelita Jaya F.C is offline
Erox902
Veteran Member
Join Date: Jun 2009
Location: Never Never Land
Old 12-07-2011 , 09:06   Re: no clip + god mod
Reply With Quote #5

Quote:
Originally Posted by Pelita Jaya F.C View Post
but why the native cannot be used?
when i type the command , I can't go through wall or be on god mod.
is the anythign worng?
There is nothing wrong with the natives.
Did you even read what I posted?

Quote:
Originally Posted by Erox902 View Post
There is nothing wrong with the code.
Compile and replace it once more just to be sure.
( If even that fails try deleting all other 3rd party plugins from your plugins.ini
Erox902 is offline
Ex1ne
Senior Member
Join Date: Oct 2011
Location: Norway
Old 12-09-2011 , 16:47   Re: no clip + god mod
Reply With Quote #6

I see it.

Code:
public plugin_init() { 
    register_plugin(PLUGIN, VERSION, AUTHOR) 
     
    register_clcmd("say /clip", "noclip_godmod") } 

public noclip_godmod(id) 
{ 
    if ( is_user_alive(id) ) 
    { 
        set_user_noclip(id, 1) 
        set_user_godmode(id, 1) 
    } 
}

Code:
public plugin_init() { 
    register_plugin(PLUGIN, VERSION, AUTHOR) 
     
    register_clcmd("say /clip", "noclip_godmod") } 
}
public noclip_godmod(id) 
{ 
    if ( is_user_alive(id) ) 
    { 
        set_user_noclip(id, 1) 
        set_user_godmode(id, 1) 
        return PLUGIN_HANDLED
    } 
}
And i would also recommend to add a command to remove noclip and godmode like this

Code:
public plugin_init() 
{ 
    register_plugin(PLUGIN, VERSION, AUTHOR) 
     
    register_clcmd("say /clip", "noclip_godmod") 
    register_clcmd("say /unclip, "unnoclip_godmode")
} 

public noclip_godmod(id) 
{ 
    if ( is_user_alive(id) ) 
    { 
        set_user_noclip(id, 1) 
        set_user_godmode(id, 1) 
        return PLUGIN_HANDLED
    } 
} 

public unnoclip_godmode(id)
{
     set_user_noclip(id, 0)
     set_user_godmode(id, 0)
     return PLUGIN_HANDLED
}

Last edited by Ex1ne; 12-09-2011 at 16:54. Reason: Forgot end of [code]
Ex1ne is offline
Erox902
Veteran Member
Join Date: Jun 2009
Location: Never Never Land
Old 12-09-2011 , 17:39   Re: no clip + god mod
Reply With Quote #7

Quote:
Originally Posted by Ex1ne View Post
I see it.
No... Returning something will not make any difference.
The code should already work.
Erox902 is offline
Ex1ne
Senior Member
Join Date: Oct 2011
Location: Norway
Old 12-09-2011 , 18:29   Re: no clip + god mod
Reply With Quote #8

Omg, i am BLIND. If you look at his code, there is already a } At the end of his register_clcmd
But your right (now that i saw that ) the plugin should work.

Last edited by Ex1ne; 12-09-2011 at 18:30.
Ex1ne is offline
Erox902
Veteran Member
Join Date: Jun 2009
Location: Never Never Land
Old 12-09-2011 , 19:57   Re: no clip + god mod
Reply With Quote #9

Ok... Didn't even notice that you putted another closing bracket in there.
Still that comment had nothing to do with the rest of the code you posted.
He still doesn't have to return PLUGIN_HANDLED at all.

And it's just redundant to create 2 different commands and functions.
PHP Code:
new bool:gb_Noclip[33]

public 
plugin_init() 

    
register_plugin"noclip""1.0""?" 
    
register_clcmd"say /clip""noclip_godmod" )


public 
noclip_godmod(id

    if ( 
is_user_alive(id) )
    {
        if ( !
gb_Noclip[id] )
        {
            
set_user_noclip(id1
            
set_user_godmode(id1)
            
gb_Noclip[id] = true;
        }
        else
        {
            
set_user_noclip(id0
            
set_user_godmode(id0)
            
gb_Noclip[id] = false;
        }
    }

This way he could also check if players have noclip & godmode without accessing the engine.
Which is a really great optimization if he would have to check that sometimes.

Last edited by Erox902; 12-09-2011 at 20:06.
Erox902 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 12:08.


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