Raised This Month: $307 Target: $400
 76%   Almost there!

light editing of the randow warmup plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
impossible89
Member
Join Date: Jun 2020
Old 08-31-2020 , 04:23   light editing of the randow warmup plugin
Reply With Quote #1

Hello! Can anyone add to the Random Warmup plugin more random weapons at the moment the weapons are only Awp, knifes, Grenade, Scout I would like Grenade to be removed and more added

what random weapons to have inside:

GALIL
MP5
SSG552
AUG
P90
UMP45
G3/SG-1
Sig 550
TMP
M3
MAC-10
XM1014
FAMAS
DEAGLE
USP
GLOCK
P228
FIVE SEVEN
BERETTA
AWP
m4a1
AK47
Scout
Knife

Code:
#include <amxmodx>
#include <fakemeta_util>
#include <cstrike>
#include <fun>
#include <dhudmessage>
#include <hamsandwich>
new Timer, SecondsCvar
//new bool:first_time=true

new g_mode = 0
/*
1 - Knife
2 - Deagle
3 - Scout
4 - AWP
5 - Grenade

*/
#define TASK_REVIVE 2312
new const szWeaponNames[][] = { "", "weapon_p228", "", "weapon_scout", "weapon_hegrenade", "weapon_xm1014", "weapon_c4", "weapon_mac10",
	"weapon_aug", "weapon_smokegrenade", "weapon_elite", "weapon_fiveseven", "weapon_ump45", "weapon_sg550",
	"weapon_galil", "weapon_famas", "weapon_usp", "weapon_glock18", "weapon_awp", "weapon_mp5navy", "weapon_m249",
	"weapon_m3", "weapon_m4a1", "weapon_tmp", "weapon_g3sg1", "weapon_flashbang", "weapon_deagle", "weapon_sg552",
"weapon_ak47", "weapon_knife", "weapon_p90" }

	public plugin_init()
{
	register_plugin( "Warmup Random" , "4.0Stable", "VCL" )
	register_event("DeathMsg", "on_death", "a")
	register_event( "CurWeapon", "EventCurWeapon", "be", "2!29" )
	RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1)  
	for (new i = 1; i < sizeof szWeaponNames; i++)
		if (szWeaponNames[i][0]) RegisterHam(Ham_Item_AddToPlayer, szWeaponNames[i], "fw_Weapon_AddToPlayer_Post", 1)
	SecondsCvar = register_cvar("wr_rr_time","90.0")
	Timer = get_pcvar_num(SecondsCvar)
	g_mode = random_num(1,5)
	if(random_num(0,1)==1) g_mode = random_num(1,5)
	set_task(1.0, "start_rr_timer", 0, _, _, "a", Timer)
}

public on_death()
{
	new victim
	victim = read_data(2)
	
	if(g_mode!=0) set_task(1.0, "fnRevivePlayer", victim+TASK_REVIVE)
}

public fw_Weapon_AddToPlayer_Post(weapon, id)
{
	if(g_mode!=0 && !task_exists(id)) set_task(0.1,"give_items",id)
}

public fwHamPlayerSpawnPost(id)
{
	if(g_mode!=0 && !task_exists(id)) set_task(0.1,"give_items",id)
	
}

public give_items(id)
{
	if(g_mode!=0 && is_user_connected(id) && is_user_alive(id))
	{
		fm_strip_user_weapons(id)
		switch(g_mode)
		{
			case 1: 
			{
				fm_give_item(id, "weapon_knife")
				set_user_health(id, 35)
			}
			case 2: 
			{ 			
				fm_give_item(id, "weapon_deagle")
				cs_set_user_bpammo(id,CSW_DEAGLE,120)
			}
			case 3:
			{
				fm_give_item(id, "weapon_scout")
				cs_set_user_bpammo(id,CSW_SCOUT, 90)
			}
			case 4:
			{ 
			        fm_give_item(id, "weapon_knife")
				fm_give_item(id, "weapon_awp")
				cs_set_user_bpammo(id,CSW_AWP,90)
			}
			case 5:
			{
				fm_give_item(id, "weapon_hegrenade")
				cs_set_user_bpammo(id,CSW_HEGRENADE, 90)
			}
		}
	}
}

public fnRevivePlayer(id) 
{
	id-=TASK_REVIVE
	if(!is_user_alive(id) && g_mode!=0 && is_user_connected(id))
	{
		ExecuteHamB(Ham_CS_RoundRespawn, id)
	}
}

public EventCurWeapon(id)
{
	/*if(g_mode!=0 && is_user_connected(id) && is_user_alive(id)) 
	{
		switch(g_mode)
		{
			case 1: engclient_cmd(id, "weapon_knife")
				case 2: engclient_cmd(id, "weapon_deagle")
				case 3: engclient_cmd(id, "weapon_scout")
				case 4: engclient_cmd(id, "weapon_awp")
				case 5: engclient_cmd(id, "weapon_hegrenade")
			}
		
	}*/
}

public start_rr_timer()
{
	
	if(get_pcvar_num(SecondsCvar)==Timer)
	{
		g_mode = random_num(1,5)
		if(random_num(0,1)==1) g_mode = random_num(1,5)
		for(new i=1;i<=32;i++)
		{
			give_items(i)
		}
	}
	Timer--
	new mode_name[32]
	switch(g_mode)
	{
		case 1: format(mode_name,charsmax(mode_name),"Knife")
			case 2: format(mode_name,charsmax(mode_name),"Deagle")
			case 3: format(mode_name,charsmax(mode_name),"Scout")
			case 4: format(mode_name,charsmax(mode_name),"AWP")
			case 5: format(mode_name,charsmax(mode_name),"Grenade")
			default: format(mode_name,charsmax(mode_name),"ERROR")
	}
	if(g_mode==0)
	{
		remove_task()
	}
	else
	{
		set_dhudmessage(135, 206, 235, -1.0, 0.08, 0, 0.0, 0.01)
		show_dhudmessage(0, "^nZagrqvasht round! %s!^nRestart sled: [ %d ]", mode_name,Timer)
	}
	if(Timer < 1)
	{
		server_cmd("sv_restartround 1")
		set_task(3.0, "rr_end")
		g_mode = 0
	}
}

public rr_end()
{
	g_mode = 0
	set_dhudmessage( random_num(0, 255), random_num(0, 255), random_num(0, 255), -1.0, 0.78, 2, 6.0, 3.0, 0.1, 1.5, false )
	new message[100]
	new servname[64]
	get_cvar_string("hostname",servname,charsmax(servname))
	format(message,charsmax(message),"Uspeh na vsichki !^nNasladete se na igrata v nashiq survur %s",servname)
	show_dhudmessage(0, message)
}
impossible89 is offline
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 02:15.


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