Raised This Month: $ Target: $400
 0% 

Noclip with time


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SpokY
Senior Member
Join Date: Feb 2009
Location: Darmstadt
Old 03-16-2009 , 03:17   Noclip with time
Reply With Quote #1

Hello Guy's

can anyone make all player's have noclip for 8 or 10 secs when a round starts?

Thanks

Code:
/*
--------------------------------------------------------------
----------------------  Made by Deviance ---------------------
--------------------- www.the-place.co.nr --------------------
--------------------------------------------------------------
*/

#include <amxmodx>
#include <amxmisc>
#include <fun>

#define Plugin "Noclip"
#define Version "1.3"
#define Author "Doombringer"

new bool:Has_to_wait[32], bool:Has_Noclip[32]
new player_noclip[32], temp

new nocliptime, noclipwait
public plugin_init()
{
	register_plugin(Plugin, Version, Author)
	
	register_clcmd("say noclipme", "noclip_init")
	register_clcmd("say_team noclipme", "noclip_init")
	
	nocliptime = register_cvar("NC_time", "30")
	noclipwait = register_cvar("NC_wait", "300")	
}

public client_putinserver(id)
{
	player_noclip[id] = get_pcvar_num(nocliptime)
}

public can_use_again(id)
{
	Has_to_wait[id] = false
	player_noclip[id] = get_pcvar_num(nocliptime)
}

public noclip_time(id)
{
	if(temp == 5 || player_noclip[id] < 6)
	{
		new number[32]
		num_to_word(player_noclip[id], number, 31)
		
		client_cmd(id, "spk ^"%s^"", number)
		temp = 0
	}
	
	player_noclip[id]--
	
	if(player_noclip[id] < 1)
	{
		set_user_noclip(id, 0)
		
		client_print(id, print_chat, "Your noclip time is over")	
		remove_task(id)
		
		Has_to_wait[id] = true
                Has_Noclip[id] = false

		set_task(float(get_pcvar_num(noclipwait)), "can_use_again", id)
		
		return PLUGIN_CONTINUE
	}
	
	temp++
	set_task(1.0, "noclip_time", id)
	
	return PLUGIN_CONTINUE
}

public give_noclip(id)
{
	set_user_noclip(id, 1)	
}

public noclip_init(id)
{
	if(Has_to_wait[id])
	{
		client_print(id, print_chat, "Sorry, you can't use noclip for the moment, try again later")
		return PLUGIN_CONTINUE
	}

	else if(Has_Noclip[id])
	{
		client_print(id, print_chat, "You already have noclip!")
		return PLUGIN_CONTINUE
	}

	else if(!is_user_alive(id))
	{
		client_print(id, print_chat, "You can't use noclip when your dead!")
		return PLUGIN_CONTINUE
	}
	
        Has_Noclip[id] = true
	
	set_task(5.0, "noclip_time", id)
	set_task(5.0, "give_noclip", id)
	
	client_print(id, print_chat, "You will get noclip in 5 seconds")
        temp = 5
	
	return PLUGIN_CONTINUE
SpokY is offline
Send a message via ICQ to SpokY Send a message via MSN to SpokY
TheRadiance
Senior Member
Join Date: Nov 2007
Location: Kazakhstan
Old 03-16-2009 , 03:41   Re: Noclip with time
Reply With Quote #2

PHP Code:
#include < amxmodx >
#include < fun >

public plugin_init( )
{
    
register_plugin"Noclip""1.0""SpokY" )
    
register_logevent"LogeventRoundStart"2"1=Round_Start" )
}

public 
LogeventRoundStart( )
{
    new 
iPlayers32 ]
    new 
iNum
    get_players
iPlayersiNum"a" )

    for ( new 
0iNuma++ )
        
set_user_noclipiPlayers], )

    
set_task9.0"TaskRemoveNoclip" )
}

public 
TaskRemoveNoclip( )
{
    new 
iPlayers32 ]
    new 
iNum
    get_players
iPlayersiNum"a" )

    for ( new 
0iNuma++ )
        
set_user_noclipiPlayers], )

TheRadiance is offline
Send a message via ICQ to TheRadiance
SpokY
Senior Member
Join Date: Feb 2009
Location: Darmstadt
Old 03-16-2009 , 14:31   Re: Noclip with time
Reply With Quote #3

Thanks but this Plugin allowed to fly 8 sec.
I mean which one through a player through to go can without this to touch oneself.
SpokY is offline
Send a message via ICQ to SpokY Send a message via MSN to SpokY
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 03-16-2009 , 16:27   Re: Noclip with time
Reply With Quote #4

@TheRadiance:
PHP Code:
for ( new 0iNuma++ )
    
set_user_noclipiPlayers], )

---->

new 
id;
for(new 
iNum a++)
{
      
id iPlayers[a]; // To avoid re-indexing.
      
      
set_user_noclip(id1);

I don't know what re-indexing means or why you should avoid it, but you just should.
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-16-2009 , 17:15   Re: Noclip with time
Reply With Quote #5

Quote:
Originally Posted by Dores View Post
I don't know what re-indexing means or why you should avoid it, but you just should.
It's usefull as soon as you gonna use many times iPlayers[a]
In thats case it's only used 1 time so you don't need to cache the value.

http://wiki.amxmodx.org/Optimizing_P...e-index_Arrays
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 03-16-2009 , 18:22   Re: Noclip with time
Reply With Quote #6

Woot! I've never seen that page(Optimizing Plugins)! Who wrote it?
And thanks, I thought so but wasn't too sure.
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
SpokY
Senior Member
Join Date: Feb 2009
Location: Darmstadt
Old 03-17-2009 , 13:49   Re: Noclip with time
Reply With Quote #7

back 2 topic please
SpokY is offline
Send a message via ICQ to SpokY Send a message via MSN to SpokY
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 03-17-2009 , 16:43   Re: Noclip with time
Reply With Quote #8

Quote:
Originally Posted by SpokY View Post
I mean which one through a player through to go can without this to touch oneself.
This is not English, I don't understand what you want.
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-17-2009 , 16:46   Re: Noclip with time
Reply With Quote #9

Quote:
Who wrote it?
BAILOPAN.
Arkshine is offline
gtpunkt
Veteran Member
Join Date: Dec 2008
Location: Berlin
Old 03-22-2009 , 14:10   Re: Noclip with time
Reply With Quote #10

Hello,
he dont want have a Noclip at round start.he mean Semiclip/Noblock at round start.
So the question should be hot.
can anyone make all player's have semiclip for 8/10 sec when a round starts?

Last edited by gtpunkt; 03-22-2009 at 14:20.
gtpunkt is offline
Send a message via Skype™ to gtpunkt
Reply


Thread Tools
Display Modes

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 08:58.


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