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

Fake gunshot


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 08-26-2006 , 11:14   Fake gunshot
Reply With Quote #1

I want to fake a gunshot in cs!
I've done all but the gunshot decal and sparks, how do I fake them where the player aims?

Thanks!
__________________
Sig(h)!
Obbin is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 08-26-2006 , 11:57   Re: Fake gunshot
Reply With Quote #2

trace line + temp entity?
VEN is offline
P34nut
AMX Mod X Beta Tester
Join Date: Feb 2006
Location: Netherlands
Old 08-26-2006 , 13:58   Re: Fake gunshot
Reply With Quote #3

Code:
#define    TE_GUNSHOT                  2        // Particle effect plus ricochet sound
// write_byte(TE_GUNSHOT)
// write_coord(position.x)
// write_coord(position.y)
// write_coord(position.z)

#define    TE_SPARKS                   9        // 8 random tracers with gravity, ricochet sprite
// write_byte(TE_SPARKS)
// write_coord(position.x)
// write_coord(position.y)
// write_coord(position.z)
these are your gunshot and your sparks temporary entities
__________________
All you need to change the world is one good lie and a river of blood
P34nut is offline
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 08-26-2006 , 15:36   Re: Fake gunshot
Reply With Quote #4

Example?
I tred with get origin form hitpoint and doing TE_GUNSHOT but it didn't work!
__________________
Sig(h)!
Obbin is offline
P34nut
AMX Mod X Beta Tester
Join Date: Feb 2006
Location: Netherlands
Old 08-26-2006 , 15:41   Re: Fake gunshot
Reply With Quote #5

Code:
public myfunction() {     new iOrigin[3]     get_user_origin(id, iOrigin, 3)         message_begin(MSG_ALL, SVC_TEMPENTITY, iOrigin)     write_byte(2) //TE_GUNSHOT     write_coord(iOrigin[0]) // Position     write_coord(iOrigin[1])     write_coord(iOrigin[2])     message_end()         message_begin(MSG_ALL, SVC_TEMPENTITY, iOrigin)     write_byte(8) //TE_SPARKS     write_coord(iOrigin[0]) // Position     write_coord(iOrigin[1])     write_coord(iOrigin[2])     message_end() }
__________________
All you need to change the world is one good lie and a river of blood
P34nut is offline
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 08-26-2006 , 16:11   Re: Fake gunshot
Reply With Quote #6

My client hangs :S

Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN      "Test" #define VERSION    "Test" #define AUTHOR      "Test" public plugin_init() {     register_plugin(PLUGIN,VERSION,AUTHOR);     register_clcmd("fs","fs"); } public fs(id) {     new iOrigin[3]     get_user_origin(id, iOrigin, 3)     message_begin(MSG_ALL, SVC_TEMPENTITY, iOrigin)     write_byte(2) //TE_GUNSHOT     write_coord(iOrigin[0]) // Position     write_coord(iOrigin[1])     write_coord(iOrigin[2])     message_end()     message_begin(MSG_ALL, SVC_TEMPENTITY, iOrigin)     write_byte(8) //TE_SPARKS     write_coord(iOrigin[0]) // Position     write_coord(iOrigin[1])     write_coord(iOrigin[2])     message_end()     return PLUGIN_HANDLED }
__________________
Sig(h)!
Obbin is offline
P34nut
AMX Mod X Beta Tester
Join Date: Feb 2006
Location: Netherlands
Old 08-26-2006 , 17:47   Re: Fake gunshot
Reply With Quote #7

Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN      "Test" #define VERSION    "Test" #define AUTHOR      "Test" public plugin_init() {     register_plugin(PLUGIN,VERSION,AUTHOR);     register_clcmd("fs","fs"); } public fs(id) {     new iOrigin[3]     get_user_origin(id, iOrigin, 3)         message_begin(MSG_ALL, SVC_TEMPENTITY, iOrigin)     write_byte(2) //TE_GUNSHOT     write_coord(iOrigin[0]) // Position     write_coord(iOrigin[1])     write_coord(iOrigin[2])     message_end()     message_begin(MSG_ALL, SVC_TEMPENTITY, iOrigin)     write_byte(9) //TE_SPARKS     write_coord(iOrigin[0]) // Position     write_coord(iOrigin[1])     write_coord(iOrigin[2])     message_end()     return PLUGIN_HANDLED }
Should work like this (write_byte( //TE_SPARKS changed to write_byte(9)
__________________
All you need to change the world is one good lie and a river of blood
P34nut 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 01:26.


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