Archived copy of war3source.com, the War3Source forum (2009–2020), rebuilt from the Internet Archive by wc3mods.net. This page was captured on 2013-01-25 (original capture). Forum · All archived topics · Wiki · Bug tracker · Blog
Chat

War3:Source
January 24, 2013, 07:06:33 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Download: http://war3source.com/index.php?board=9.0
What is War3Source?: http://war3source.com/index.php?topic=200.0
Sample Stats: http://war3source.com/war3stats
Steam Community Group: http://steamcommunity.com/groups/war3source
War3Source SVN Checkout: http://ownageclan.com/svn/war3source/
War3Source servers: http://www.game-monitor.com/search.php?vars=war3_version=
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [Snippet] Weapon_ShootPosition (cstrike)  (Read 100 times)
Revan
Sr. Member
****
Posts: 346



View Profile
« on: January 02, 2013, 02:36:55 PM »

I haven't tested this

1. Put this snippet somewhere into the plugin
Code:
new Handle:hGetWeaponPosition = INVALID_HANDLE;
public OnPluginStart()
{
new Handle:hGameConf = LoadGameConfigFile("w3s.cstrike");

StartPrepSDKCall(SDKCall_Player);
PrepSDKCall_SetFromConf(hGameConf, SDKConf_Virtual, "Weapon_ShootPosition");
PrepSDKCall_SetReturnInfo(SDKType_Vector, SDKPass_ByValue);
hGetWeaponPosition = EndPrepSDKCall();
}

// then just use this:
new Float:weaponPosition[3];
SDKCall( hGetWeaponPosition, client, weaponPosition );
2. Create a gamedata file called "w3s.cstrike.txt" and paste this into it
Code:
"Games"
{
"cstrike"
{
"Offsets"
{
"Weapon_ShootPosition"
{
"windows" "261"
"linux" "262"
"mac" "262"
}
}
}
}


If you want to attach a smoketrail to the weapon use a particleSystem or env_smokestack then set the position offset and you should be fine Smiley
another possible way is to use TE_SetupBeamFollow(or similar) on the weapon entity and use a smokish material.

This should work on other games too, you just need to add a entry to the gamedata file with the correct vtable offset.
Logged

#war3source
Ownz
Developer
Administrator
Hero Member
*****
Posts: 2169



View Profile WWW
« Reply #1 on: January 02, 2013, 02:41:49 PM »

basically where the person's weapon nozzle is?
Logged

DarkEnergy
Revan
Sr. Member
****
Posts: 346



View Profile
« Reply #2 on: January 02, 2013, 02:50:09 PM »

exactly
Logged

#war3source
Remy Lebeau
Full Member
***
Posts: 172


View Profile
« Reply #3 on: January 02, 2013, 08:49:42 PM »

fantastic- I'll play around with this, thanks Cheesy
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!