public void OnPluginStart() { Handle hGameConf = LoadGameConfigFile("tf2.dispenser"); if(hGameConf == INVALID_HANDLE) SetFailState("tf2.dispenser.txt Not Found check you gamedata folder");
int DispenseAmmoOffset = GameConfGetOffset(hGameConf, "CObjectDispenser::DispenseAmmo"); if(DispenseAmmoOffset == -1) SetFailState("Failed To Get Offset For CObjectDispenser::DispenseAmmo");
int DispenseMetalOffset = GameConfGetOffset(hGameConf, "CObjectDispenser::DispenseMetal"); if(DispenseMetalOffset == -1) SetFailState("Failed To Get Offset For CObjectDispenser::DispenseMetal");
int StartHealingOffset = GameConfGetOffset(hGameConf, "CObjectDispenser::StartHealing"); if(StartHealingOffset == -1) SetFailState("Failed To Get Offset For CObjectDispenser::StartHealing");
only tested in linux
thisp is the dispenser
you can also make client-specific by using DHookGetParam(Handle:hParams, num);
Chdata
03-16-2015 08:40
Re: [DHOOKS][TF2] block dispenser heal/ammo/metal
this doesn't require a gamedata.txt that has to constantly be reupdated?
arthurdead
03-16-2015 11:53
Re: [DHOOKS][TF2] block dispenser heal/ammo/metal
Quote:
Originally Posted by Chdata
(Post 2274437)
this doesn't require a gamedata.txt that has to constantly be reupdated?
only if valve changes CObjectDispenser ?
even if it changes you can easily find another in seconds
arthurdead
03-16-2015 17:02
Re: [DHOOKS][TF2] block dispenser heal/ammo/metal
added a better example
Chdata
03-17-2015 09:33
Re: [DHOOKS][TF2] block dispenser heal/ammo/metal
What I mean is, you didn't include one of those gamedata.txt's, and I saw GameConfGetOffset or something, and thought there was some new command to get those offsets automatically, and that the comment with the offsets was just there cause you were making sure or something.
arthurdead
03-17-2015 11:51
Re: [DHOOKS][TF2] block dispenser heal/ammo/metal
Quote:
Originally Posted by Chdata
(Post 2274826)
What I mean is, you didn't include one of those gamedata.txt's, and I saw GameConfGetOffset or something, and thought there was some new command to get those offsets automatically, and that the comment with the offsets was just there cause you were making sure or something.
oh i see no that was just lazyness will add gamedata
arthurdead
03-18-2015 20:23
Re: [DHOOKS][TF2] block dispenser heal/ammo/metal
should have mentioned but you can call the individual functions with sdkcalls like so :
PHP Code:
SDKCall(hStartHealingCall, dispenser, client); SDKCall(hRemoveHealingTargetCall, dispenser, client); //linux only SDKCall(hDispenseMetalCall, dispenser, client); //depleates dispenser metal SDKCall(hDispenseAmmoCall, dispenser, client); //depleates dispenser metal
also added a non-working dispenser heal enemies thing (commented code) if you hook touch you get a beam and no heal if you hook StartTouch and get in the right spot with noclip you mighty get a beam and heal
Chdata
04-06-2015 07:27
Re: [DHOOKS][TF2] block dispenser heal/ammo/metal
Works pretty well. I modified it to make it so your dispenser won't dispense metal to other engies on your team if you have less than 200 metal yourself.
barel31
04-06-2015 14:20
Re: [DHOOKS][TF2] block dispenser heal/ammo/metal
Looking for a way to block dispensers ammo for a while.
thanks a lot.
Chdata
07-03-2015 14:11
Re: [DHOOKS][TF2] block dispenser heal/ammo/metal
Needs new offsets, these crash servers now if someone even tries to select building a dispenser.