AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   noclip plugin (https://forums.alliedmods.net/showthread.php?t=173747)

RuRuRu612754 12-09-2011 23:38

noclip plugin
 
What should I do?

Code:

#include <amxmodx>
#include <fun>

new user_noclip

new user_noclip_enable = false

public plugin_init()
{
        register_plugin("PLUGIN", "VERSION", "AUTHOR")

        user_noclip = register_cvar("user_noclip", "1")

        register_clcmd("say /noclip", "noclip")
}

public noclip(id)
{
        if(get_pcvar_num(user_noclip) == 1)
        {
                if(user_noclip_enable == false)
                {
                        set_user_noclip(id, 1)

                        user_noclip_enable = true
                }
                if(user_noclip_enable == true)
                {
                        set_user_noclip(id, 0)

                        user_noclip_enable = false
                }
        }
}


Snaker beatter 12-10-2011 00:06

Re: noclip plugin
 
when client say "/noclip" we will be no clip, so?

RuRuRu612754 12-10-2011 00:23

Re: noclip plugin
 
yes
client say "/noclip" not noclip mode

The client in this state user_noclip_enable = false "/ noclip" says to noclip mode on
The client in this state user_noclip_enable = true "/ noclip" says to noclip mode on

this is my Ideally

Snaker beatter 12-10-2011 01:01

Re: noclip plugin
 
Can't understand you

RuRuRu612754 12-10-2011 02:01

Re: noclip plugin
 
sorry
I cannot speak english
I use google translation.

Snaker beatter 12-10-2011 02:05

Re: noclip plugin
 
Must explain understandable :down:

ConnorMcLeod 12-10-2011 02:38

Re: noclip plugin
 
PHP Code:

#include <amxmodx>
#include <fun>

new user_noclip

public plugin_init()
{
    
register_plugin("PLUGIN""VERSION""AUTHOR")

    
user_noclip register_cvar("user_noclip""1")

    
register_clcmd("say /noclip""noclip")
}

public 
noclip(id)
{
    if( 
get_pcvar_num(user_noclip) && is_user_alive(id) )
    {
        
set_user_noclip(id, !get_user_noclip(id))
    }



Devil259 12-10-2011 05:00

Re: noclip plugin
 
@RuRuRu : Your bool must be an array in your case.

new bool:blabla[MAX_PLAYERS+1] where MAX_PLAYERS = 32, so blabla[33]

RuRuRu612754 12-10-2011 07:01

Re: noclip plugin
 
all answer thanks


All times are GMT -4. The time now is 11:46.

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