Raised This Month: $51 Target: $400
 12% 

leave only the bomb


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jonny1990
Senior Member
Join Date: Apr 2020
Old 06-28-2020 , 04:49   leave only the bomb
Reply With Quote #1

Hello everyone) this plugin is responsible for the fact that when you throw a weapon or a bomb, it turns in the air, but how to do that would only turn the bomb

Code:
/*
*   _______     _      _  __          __
*  | _____/    | |    | | \ \   __   / /
*  | |         | |    | |  | | /  \ | |
*  | |         | |____| |  | |/ __ \| |
*  | |   ___   | ______ |  |   /  \   |
*  | |  |_  |  | |    | |  |  /    \  |
*  | |    | |  | |    | |  | |      | |
*  | |____| |  | |    | |  | |      | |
*  |_______/   |_|    |_|  \_/      \_/
*
*
*
*  Last Edited: 12-31-07
*
*  ============
*   Changelog:
*  ============
*
*  v2.0
*    -Added color to floating weapons
*
*  v1.0
*    -Initial Release
*
*/

#define VERSION	"2.0"

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <fun>

new maxplayers
new speed_pcvar
new toggle_pcvar

public plugin_init()
{
	register_plugin("UT Style Floating Weapons",VERSION,"GHW_Chronic")

	speed_pcvar = register_cvar("FW_speed","25.0")
	toggle_pcvar = register_cvar("FW_enabled","1")

	register_forward(FM_SetModel,"W_Model_Hook",1)
	register_touch("weaponbox","worldspawn","touch")
	set_task(1.0,"newgame")

	set_task(0.1,"force_spin",0,"",0,"b")

	maxplayers = get_maxplayers()
}

public W_Model_Hook(ent,model[])
{
	if(get_pcvar_num(toggle_pcvar) && pev_valid(ent))
	{
		static classname[32]
		pev(ent,pev_classname,classname,31)
		if(equali(classname,"weaponbox"))
		{
			set_pev(ent,pev_renderfx,kRenderFxGlowShell)
			switch(random_num(1,4))
			{
				case 1: set_pev(ent,pev_rendercolor,Float:{0.0,0.0,255.0})
				case 2: set_pev(ent,pev_rendercolor,Float:{0.0,255.0,0.0})
				case 3: set_pev(ent,pev_rendercolor,Float:{255.0,0.0,0.0})
				case 4: set_pev(ent,pev_rendercolor,Float:{255.0,255.0,255.0})
			}
			static Float:angles[3]
			pev(ent,pev_angles,angles)
			angles[0] -= 90.0
			angles[1] += 45.0
			set_pev(ent,pev_angles,angles)
		}
	}
}

public touch(weaponbox,worldspawn)
{
	if(get_pcvar_num(toggle_pcvar) && pev_valid(weaponbox))
	{
		
		set_pev(weaponbox,pev_movetype,MOVETYPE_FLY)
		static Float:origin[3]
		pev(weaponbox,pev_origin,origin)
		origin[2] += 30.0
		set_pev(weaponbox,pev_origin,origin)
	}
}

public force_spin()
{
	if(get_pcvar_num(toggle_pcvar))
	{
		static ent, classname[16], Float:angles[3]
		ent = engfunc(EngFunc_FindEntityInSphere,maxplayers,Float:{0.0,0.0,0.0},4800.0)
		while(ent)
		{
			if(pev_valid(ent))
			{
				pev(ent,pev_classname,classname,15)
				if(containi(classname,"armoury")!=-1 || containi(classname,"weaponbox")!=-1)
				{
					pev(ent,pev_angles,angles)
					angles[1] += get_pcvar_float(speed_pcvar) / 10.0
					if(angles[1]>=180.0)
					{
						angles[1] -= 360.0
					}
					set_pev(ent,pev_angles,angles)
				}
			}
			ent = engfunc(EngFunc_FindEntityInSphere,ent,Float:{0.0,0.0,0.0},4800.0)
		}
	}
}

public newgame()
{
	if(get_pcvar_num(toggle_pcvar))
	{
		static ent, classname[8], Float:angles[3]
		ent = engfunc(EngFunc_FindEntityInSphere,maxplayers,Float:{0.0,0.0,0.0},4800.0)
		while(ent)
		{
			if(pev_valid(ent))
			{
				pev(ent,pev_classname,classname,7)
				if(containi(classname,"armoury")!=-1)
				{
					set_pev(ent,pev_renderfx,kRenderFxGlowShell)
					switch(random_num(1,4))
					{
						case 1: set_pev(ent,pev_rendercolor,Float:{0.0,0.0,255.0})
						case 2: set_pev(ent,pev_rendercolor,Float:{0.0,255.0,0.0})
						case 3: set_pev(ent,pev_rendercolor,Float:{255.0,0.0,0.0})
						case 4: set_pev(ent,pev_rendercolor,Float:{255.0,255.0,255.0})
					}
					pev(ent,pev_angles,angles)
					angles[0] -= 90.0
					angles[1] += 45.0
					set_pev(ent,pev_angles,angles)
					touch(ent,0)
				}
			}
			ent = engfunc(EngFunc_FindEntityInSphere,ent,Float:{0.0,0.0,0.0},4800.0)
		}
	}
}

Last edited by jonny1990; 06-28-2020 at 16:00.
jonny1990 is offline
jonny1990
Senior Member
Join Date: Apr 2020
Old 06-28-2020 , 13:16   Re: leave only the bomb
Reply With Quote #2

can you help, no one knows how to do just c4
jonny1990 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-28-2020 , 13:29   Re: leave only the bomb
Reply With Quote #3

Check if the weaponbox entity has m_bIsBomb set.
__________________
HamletEagle is offline
jonny1990
Senior Member
Join Date: Apr 2020
Old 06-28-2020 , 13:52   Re: leave only the bomb
Reply With Quote #4

Quote:
Originally Posted by HamletEagle View Post
Check if the weaponbox entity has m_bIsBomb set.
I don't understand you
jonny1990 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-28-2020 , 15:22   Re: leave only the bomb
Reply With Quote #5

Search about m_bIsBomb. I gave you a hint, do some research.
__________________
HamletEagle is offline
jonny1990
Senior Member
Join Date: Apr 2020
Old 06-28-2020 , 16:13   Re: leave only the bomb
Reply With Quote #6

Quote:
Originally Posted by HamletEagle View Post
Search about m_bIsBomb. I gave you a hint, do some research.
you say you need to prescribe this m_bIsBomb? but where exactly
jonny1990 is offline
jonny1990
Senior Member
Join Date: Apr 2020
Old 07-03-2020 , 13:56   Re: leave only the bomb
Reply With Quote #7

do not understand
jonny1990 is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 07-03-2020 , 14:03   Re: leave only the bomb
Reply With Quote #8

this is scripting help section, not request.

This is the hint which more than enough
Quote:
Originally Posted by HamletEagle View Post
Check if the weaponbox entity has m_bIsBomb set.
Hint2: get_pdata_bool
__________________
My plugin:

Last edited by Celena Luna; 07-03-2020 at 14:04.
Celena Luna is offline
jonny1990
Senior Member
Join Date: Apr 2020
Old 07-03-2020 , 14:16   Re: leave only the bomb
Reply With Quote #9

Quote:
Originally Posted by Celena Luna View Post
this is scripting help section, not request.

This is the hint which more than enough


Hint2: get_pdata_bool
this is the help section
jonny1990 is offline
jonny1990
Senior Member
Join Date: Apr 2020
Old 07-03-2020 , 14:18   Re: leave only the bomb
Reply With Quote #10

I tried everything but it doesn't work
jonny1990 is offline
Reply



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 19:53.


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