AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   no clip + god mod (https://forums.alliedmods.net/showthread.php?t=173548)

Pelita Jaya F.C 12-07-2011 01:36

no clip + god mod
 
Hi all! yes it's me :mrgreen:

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

Pelita Jaya F.C 12-07-2011 03:52

Re: no clip + god mod
 
bump!

Erox902 12-07-2011 04:01

Re: no clip + god mod
 
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! )

Pelita Jaya F.C 12-07-2011 06:47

Re: no clip + god mod
 
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?

Erox902 12-07-2011 09:06

Re: no clip + god mod
 
Quote:

Originally Posted by Pelita Jaya F.C (Post 1609041)
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 (Post 1608990)
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


Ex1ne 12-09-2011 16:47

Re: no clip + god mod
 
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)
    }
}

:arrow:
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
}


Erox902 12-09-2011 17:39

Re: no clip + god mod
 
Quote:

Originally Posted by Ex1ne (Post 1610449)
I see it.

No... Returning something will not make any difference.
The code should already work.

Ex1ne 12-09-2011 18:29

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

Erox902 12-09-2011 19:57

Re: no clip + god mod
 
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.


All times are GMT -4. The time now is 12:08.

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