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 itpublic 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 );
Code:
"Games"
{
"cstrike"
{
"Offsets"
{
"Weapon_ShootPosition"
{
"windows" "261"
"linux" "262"
"mac" "262"
}
}
}
}
{
"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

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


DarkEnergy