Raised This Month: $ Target: $400
 0% 

weapon_c4 at round start


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
katna
Senior Member
Join Date: May 2010
Old 08-10-2011 , 05:31   weapon_c4 at round start
Reply With Quote #1

i'm trying to save the c4 entity id in a global variable but when the round start, instead of getting one "weapon_c4", i got 2 entity of c4 bombs... my question is, why do i get 2 of them ( at any map ) and which one is the real one...

at round start event. the code is only for checking why do i get 2
gBomb is returning the first c4 id but why there are 2 weapon_c4
Code:
gBomb = engfunc(EngFunc_FindEntityByString, -1, "classname", "weapon_c4")
	if (!gBomb)	
		return
Code:
        new EntClass[32]
	new Entity
	new Float:fOrigin[3]
	pev(1, pev_origin, fOrigin)
	while((Entity = engfunc (EngFunc_FindEntityInSphere, Entity, fOrigin, -1)))
	{
		pev(Entity, pev_classname, EntClass, 31)
		ColorChat(0, "Entity id: %d, Entity class: %s", Entity, EntClass)
	}
katna is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-10-2011 , 05:51   Re: weapon_c4 at round start
Reply With Quote #2

Start to explain what you want to do exactly.
__________________
Arkshine is offline
katna
Senior Member
Join Date: May 2010
Old 08-10-2011 , 06:30   Re: weapon_c4 at round start
Reply With Quote #3

i just need the c4 entity id at every round start. but instead of getting one weapon_c4 entity as it should be ( i suppose ), i got 2 of them
katna is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 08-10-2011 , 07:54   Re: weapon_c4 at round start
Reply With Quote #4

He meant what you really want to do with that c4 entity, why do you need it ?

Because the c4 is tricky and you might go at this all wrong... for example, the placed c4 has "grenade" classname.
__________________
Hunter-Digital is offline
katna
Senior Member
Join Date: May 2010
Old 08-10-2011 , 08:00   Re: weapon_c4 at round start
Reply With Quote #5

no, the c4 isn't going to be planted at all. i just need the c4 id because, of a few thing

- Glow c4 ( i know i don't need his specific id to glow it )
- Give a specifi player the c4 if it is dropped on the floor.

And i need the c4 id in a global var for later uses
katna is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 08-10-2011 , 08:03   Re: weapon_c4 at round start
Reply With Quote #6

Have you looked at any of this??

https://forums.alliedmods.net/showth...highlight=bomb
Doc-Holiday is offline
katna
Senior Member
Join Date: May 2010
Old 08-10-2011 , 08:10   Re: weapon_c4 at round start
Reply With Quote #7

Quote:
Originally Posted by Doc-Holiday View Post
yes, my problem is when i'm using this at round start event

Code:
new bomb = fm_find_ent_by_class(-1, "weapon_c4")
i get 2 weapon_c4 instead of one
katna is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 08-10-2011 , 08:14   Re: weapon_c4 at round start
Reply With Quote #8

Have you tried doing it at playerspawn??
and you can use
PHP Code:
#define fm_find_ent_by_class(%1,%2) engfunc( EngFunc_FindEntityByString, %1, "classname", %2 ) 
instead of the fakemeta_util i was told its very slow.
Doc-Holiday is offline
katna
Senior Member
Join Date: May 2010
Old 08-10-2011 , 08:39   Re: weapon_c4 at round start
Reply With Quote #9

i think i got a solution but, can i use
Code:
fm_transfer_user_gun(0, id, CSW_C4)
to give the c4 to a player from the ground?
katna is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 08-10-2011 , 08:46   Re: weapon_c4 at round start
Reply With Quote #10

Quote:
Originally Posted by katna View Post
i think i got a solution but, can i use
Code:
fm_transfer_user_gun(0, id, CSW_C4)
to give the c4 to a player from the ground?
You can find who has the c4 using fm util and make the person switch and drop it.
Doc-Holiday 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 17:27.


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