Raised This Month: $ Target: $400
 0% 

Delay script with 10 seconds


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
erkz
Junior Member
Join Date: Jun 2012
Old 06-20-2012 , 19:11   Delay script with 10 seconds
Reply With Quote #1

Is it possible to delay this script with 10 secons? It runs on the start of every rounds. I have Hide N' Seek plugin which drops/delete all weapons on the start of every round, so it doesn't work well together. Tips?

Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta_util>

#define WAIT 0.1

new PLUG[] = "HNSExtras"
new VERS[] = "1.2"
new AUTH[] = "Stewie!"

new hnse_on;

new awp_on;
new fiveseven_on;
new deagle_on;
new scout_on;
new nade_on;

public plugin_init()
{
	register_plugin(PLUG, VERS, AUTH);
	register_cvar("HNSExtras", VERS, FCVAR_SERVER|FCVAR_UNLOGGED);
	
	register_logevent("round_start", 2, "1=Round_Start");
	
	register_forward(FM_ClientKill, "client_kill")
	
	hnse_on = register_cvar("hnse_on", "1");
	
	awp_on = register_cvar("hnse_awp_on", "1", ADMIN_ADMIN);
	fiveseven_on = register_cvar("hnse_fiveseven_on", "1", ADMIN_ADMIN);
	deagle_on = register_cvar("hnse_deagle_on", "1", ADMIN_ADMIN);
	scout_on = register_cvar("hnse_scout_on", "1", ADMIN_ADMIN);
	nade_on = register_cvar("hnse_nade_on", "1", ADMIN_ADMIN);
}

public round_start()
{
	set_task(WAIT, "strip")
}

public strip()
{
	if(get_pcvar_num(hnse_on))
	{
		new players[32], num;
		get_players(players, num, "ah");
		new player;
		for(new i = 0; i < num; i++)
		{
			player = players[i];
			
			fm_strip_user_weapons(player);
			cs_set_user_money(player, 0);
			fm_give_item(player, "weapon_knife");
		}
	}
	set_task(WAIT, "weapon_chance");
}

public weapon_chance()
{
	new Players[32], playerCount, i, id;
	get_players(Players, playerCount, "ah");
	for(i=0; i<playerCount; i++)
	{
		id = Players[i];
		
		new number = random_num(0, 100);
		
		switch(number)
		{
			case 1 .. 5:
			{
				if(get_pcvar_num(scout_on))
				{
					new scout = fm_give_item(id, "weapon_scout");
					cs_set_user_bpammo(id, CSW_SCOUT, 0);
					cs_set_weapon_ammo(scout, 1);
					client_print(id, print_chat, "[5%%] You have been awarded a scout with 1 bullet!");
				}
			}
			case 6 .. 15:
			{
				if(get_pcvar_num(deagle_on))
				{
					new deagle = fm_give_item(id, "weapon_deagle");
					cs_set_user_bpammo(id, CSW_DEAGLE, 0);
					cs_set_weapon_ammo(deagle, 2);
					client_print(id, print_chat, "[10%%] You have been awarded a deagle with 2 bullets!");
				}
			}
			case 16 .. 20:
			{
				if(get_pcvar_num(fiveseven_on))
				{
					new fiveseven = fm_give_item(id, "weapon_fiveseven");
					cs_set_user_bpammo(id, CSW_FIVESEVEN, 0);
					cs_set_weapon_ammo(fiveseven, 3);
					client_print(id, print_chat, "[5%%] You have been awarded a fiveseven with 3 bullets!");
				}
			}
			case 21 .. 22:
			{
				if(get_pcvar_num(awp_on))
				{
					new awp = fm_give_item(id, "weapon_awp");
					cs_set_user_bpammo(id, CSW_AWP, 0);
					cs_set_weapon_ammo(awp, 1);
					client_print(id, print_chat, "[1%%] You have been awarded an awp with 1 bullet!");
				}
			}
			case 23 .. 37:
			{
				if(get_pcvar_num(nade_on))
				{
					new nade = fm_give_item(id, "weapon_hegrenade");
					cs_set_user_bpammo(id, CSW_HEGRENADE, 0);
					cs_set_weapon_ammo(nade, 1);
					client_print(id, print_chat, "[15%%] You have been awarded a HE grenade!")
				}
			}
			case 38 .. 100:
			{
				client_print(id, print_chat, "You have not been awarded any items");
			}
		}
	}
}

public client_kill(id)
{
	if(is_user_alive(id))
	{
		console_print(id, "You cannot kill yourself at this moment in time!");
		
		return PLUGIN_HANDLED;
	}
	else
	{
		console_print(id, "You can only kill yourself when you are alive!")
		
		return PLUGIN_HANDLED;
	}
	
	return PLUGIN_CONTINUE;
}
erkz is offline
 



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 06:14.


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