AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Force Player to Shoot (https://forums.alliedmods.net/showthread.php?t=84406)

Exolent[jNr] 01-25-2009 14:00

Force Player to Shoot
 
I know the code
Code:
client_cmd(index, "+attack;wait;-attack");
But, isn't there a way to do it that doesn't use client_cmd().
Maybe there is a way with TraceLine, TraceAttack, etc?

Arkshine 01-25-2009 14:12

Re: Force Player to Shoot
 
ExecuteHam(Ham_Weapon_PrimaryAttack, iWeaponEnt ); ?

ConnorMcLeod 01-25-2009 14:29

Re: Force Player to Shoot
 
Quote:

Originally Posted by arkshine (Post 750006)
ExecuteHam(Ham_Weapon_PrimaryAttack, iWeaponEnt ); ?

That could be a way, but if the player has a gun on, and already hold on +attack, the gun won't shot again (except for glock @ semi-auto)

Exolent[jNr] 01-25-2009 14:31

Re: Force Player to Shoot
 
Thanks, it works!
But, the animations and the sounds aren't played.

Dores 01-25-2009 15:01

Re: Force Player to Shoot
 
Quote:

Originally Posted by Exolent[jNr] (Post 750016)
Thanks, it works!
But, the animations and the sounds aren't played.

Why not just play them at the same time that you execute the forward?

Code:
ExecuteHam(Ham_Weapon_PrimaryAttack, iWeaponEnt); set_pev(id, pev_weaponanim, shot's animation's value); emit_sound(0, ..... "weapons_weaponname_[1|2].wav" ....);

Arkshine 01-25-2009 15:08

Re: Force Player to Shoot
 
Not a good way, it should have another way to trigger the attack.

Drak 01-25-2009 18:03

Re: Force Player to Shoot
 
Code:
EngFunc_PlaybackEvent


All times are GMT -4. The time now is 01:54.

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