AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Possible to throw multiple HE's? (https://forums.alliedmods.net/showthread.php?t=47889)

tinlab 11-29-2006 07:04

Possible to throw multiple HE's?
 
is it possible to throw multiple HE gnades? in the script im writing, a player gets a gun that launches multiple HE nades (gun is just a HE skin). i want something like 10 HE's at the same time, or near same time. will it work?

dutchmeat 11-29-2006 08:01

Re: Possible to throw multiple HE's?
 
I think you'll have to make your own HE grenade, and throw it on attackbutton.
The are some other plugins that have there own grenade, you should try the search button :)

The Specialist 11-29-2006 09:06

Re: Possible to throw multiple HE's?
 
i think thats a little above your head but you can try it . What your going to have to do is create an entity ("info_target") then give the entity a model , and connect it to the player suing the ~IN_ATTACK button , when the press attack then you set the vectors and origins in the direction there aiming . then use pfn_touch or register_touch to tell when a grenade touches a player and do damage. :wink:

dutchmeat 11-29-2006 11:00

Re: Possible to throw multiple HE's?
 
Quote:

Originally Posted by The Specialist (Post 408440)
i think thats a little above your head but you can try it . What your going to have to do is create an entity ("info_target") then give the entity a model , and connect it to the player suing the ~IN_ATTACK button , when the press attack then you set the vectors and origins in the direction there aiming . then use pfn_touch or register_touch to tell when a grenade touches a player and do damage. :wink:

The actual grenade doesn't do damage, the explosion does.

Zenith77 11-29-2006 13:30

Re: Possible to throw multiple HE's?
 
Instead of creating it with the classname "info_target" (sort of a generic entity), you can just set the classname to "grenade", set some values on it (like think), and maybe CS will handle it...

Orangutanz 11-29-2006 14:05

Re: Possible to throw multiple HE's?
 
Here is a dump for you when the grenade was thrown from the player:
Code:

Printing out entity #102 variable information...
(variable name = value (meaning))
pev_classname = 66683048 ("grenade")
pev_globalname = 0 ("")
pev_origin = Vector (-1437.0, -707.5, 228.0)
pev_oldorigin = Vector (0.0, 0.0, 0.0)
pev_velocity = Vector (-606.8, 138.8, -146.2) - Length 639.437 - Length2D 622.492
pev_basevelocity = Vector (0.0, 0.0, 0.0) - Length 0.000 - Length2D 0.000
pev_clbasevelocity = Vector (0.0, 0.0, 0.0) - Length 0.000 - Length2D 0.000
pev_movedir = Vector (0.0, 0.0, 0.0)
pev_angles = Vector (4.3, 167.1, 0.0)
pev_avelocity = Vector (0.0, 0.0, 0.0) - Length 0.000 - Length2D 0.000
pev_punchangle = Vector (0.0, 0.0, 0.0)
pev_v_angle = Vector (0.0, 0.0, 0.0)
pev_endpos = Vector (0.0, 0.0, 0.0)
pev_startpos = Vector (0.0, 0.0, 0.0)
pev_impacttime = 0.000
pev_starttime = 0.000
pev_fixangle = 0 (nothing)
pev_idealpitch = 0.000
pev_pitch_speed = 0.000
pev_ideal_yaw = 0.000
pev_yaw_speed = 0.000
pev_modelindex = 177
pev_model = 66686696 ("models/w_hegrenade.mdl")
pev_viewmodel = 0 ("")
pev_weaponmodel = 0 ("")
pev_absmin = Vector (-1438.0, -708.5, 227.0)
pev_absmax = Vector (-1436.0, -706.5, 229.0)
pev_mins = Vector (0.0, 0.0, 0.0)
pev_maxs = Vector (0.0, 0.0, 0.0)
pev_size = Vector (0.0, 0.0, 0.0)
pev_ltime = 0.000 (current time is 69.921)
pev_nextthink = 69.950 (current time is 69.921)
pev_movetype = 10 (MOVETYPE_BOUNCE)
pev_solid = 2 (SOLID_BBOX)
pev_skin = 0 ("")
pev_body = 0 ("")
pev_effects = 0 ()
pev_gravity = 0.550 (fraction /1 of normal)
pev_friction = 0.699
pev_light_level = 0
pev_sequence = 4 ("")
pev_gaitsequence = 1 ("")
pev_frame = 0.000 (position /255 of total in sequence)
pev_animtime = 69.850 (current time is 69.921)
pev_framerate = 1.000 (times normal speed)
pev_controller = {148969728, 148969728, 148969728, 148969728}
pev_blending = {148969728, 148969728}
pev_scale = 0.000
pev_rendermode = 0 (kRenderNormal)
pev_renderamt = 0.000
pev_rendercolor = Vector (0.0, 0.0, 0.0) (RGB)
pev_renderfx = 0 (kRenderFxNone)
pev_health = 0.000
pev_frags = 0.000
pev_weapons = 0 (00000000000000000000000000000000)
pev_takedamage = 0.0 (DAMAGE_NO)
pev_deadflag = 0 (DEAD_NO)
pev_view_ofs = Vector (0.0, 0.0, 0.0)
pev_button = 0 ()
pev_impulse = 0
pev_chain = NULL
pev_dmg_inflictor = NULL
pev_enemy = NULL
pev_aiment = NULL
pev_owner = Entity #1 ("player")
pev_groundentity = Entity #0 ("worldspawn")
pev_spawnflags = 0 (00000000000000000000000000000000)
pev_flags = 0 ()
pev_colormap = 0 (0x0)
pev_team = 0
pev_max_health = 0.000
pev_teleport_time = 0.000
pev_armortype = 0.000
pev_armorvalue = 0.000
pev_waterlevel = 0 (not in water)
pev_watertype = -1
pev_target = 0 ("")
pev_targetname = 0 ("")
pev_netname = 0 ("")
pev_message = 0 ("")
pev_dmg_take = 0.000
pev_dmg_save = 0.000
pev_dmg = 100.000
pev_dmgtime = 70.550 (current time is 69.921)
pev_noise = 0 ("")
pev_noise1 = 0 ("")
pev_noise2 = 0 ("")
pev_noise3 = 0 ("")
pev_speed = 0.000
pev_air_finished = 0.000
pev_pain_finished = 0.000
pev_radsuit_finished = 0.000
pev_pContainingEntity = Entity #102 ("grenade")
pev_playerclass = 0
pev_maxspeed = 0.000
pev_fov = 0.000
pev_weaponanim = 0
pev_pushmsec = 0
pev_bInDuck = 0 (FALSE)
pev_flTimeStepSound = 0 (current time is 69.921)
pev_flSwimTime = 0 (current time is 69.921)
pev_flDuckTime = 0 (current time is 69.921)
pev_iStepLeft = 0
pev_flFallVelocity = 0.000
pev_gamestate = 0
pev_oldbuttons = 0 ()
pev_groupinfo = 0
pev_iuser1 = 0
pev_iuser2 = 0
pev_iuser3 = 0
pev_iuser4 = 0
pev_fuser1 = 0.000
pev_fuser2 = 0.000
pev_fuser3 = 0.000
pev_fuser4 = 0.000
pev_vuser1 = Vector (0.0, 0.0, 0.0)
pev_vuser2 = Vector (0.0, 0.0, 0.0)
pev_vuser3 = Vector (0.0, 0.0, 0.0)
pev_vuser4 = Vector (0.0, 0.0, 0.0)
pev_euser1 = NULL
pev_euser2 = NULL
pev_euser3 = NULL
pev_euser4 = NULL
End of dump.

Hope this helps :wink:
I think a key factor is this:
pev_dmgtime = 70.550 (current time is 69.921)

I did a few dumps and it seems like dmgtime is when it explodes.

stupok 11-29-2006 18:31

Re: Possible to throw multiple HE's?
 
Wouldn't it be easier to hook when a user pushes attack, check if its a grenade, and then give the user another grenade and force him to the grenade slot, force him to throw it, looped 10 times?

OR change the clipammo for the nade to 10, give ten nades, and just force slot and attack 10 times?

I wonder how fast they would be thrown using this method though...

dutchmeat 11-29-2006 18:42

Re: Possible to throw multiple HE's?
 
You are forgetting possible weaponchanges after one nade, it'll interupt.

Zenith77 11-29-2006 23:11

Re: Possible to throw multiple HE's?
 
Quote:

Originally Posted by dutchmeat (Post 408651)
You are forgetting possible weaponchanges after one nade, it'll interupt.

I really woundn't consider this a problem, because it only makes sense that it does so.

tinlab 11-30-2006 06:57

Re: Possible to throw multiple HE's?
 
if i created 10 ents and gave them all the he nade mdl,then i would need to make them appear upon relase of the orignal HE and then give them damage when they explode? i want to use this method unless there is an easier way.
oh and btw what is a dump? i dont know so can someone tell me?


All times are GMT -4. The time now is 06:56.

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