Raised This Month: $ Target: $400
 0% 

Noclip with time


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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