| closedOrpheu -> virtualFunctions |
| Started by Dr.G on 02-14-2010, 05:56 PM |
Threads: 75
Joined: Nov 2007
This is a quick test of the Orpheu module. It looks like its working very well...rnrnIs this better then Hamsandwich? I dont know, but its looks more stabil IMO.rnrnrn
/* Plugin generated by AMXX-Studio */rn////////////////////////////////////////////////////////////////////////////////////////////////////rn#include <amxmodx>rn#include <Orpheu>rn////////////////////////////////////////////////////////////////////////////////////////////////////rn#define PLUGIN "DoD Orpheu testing"rn#define VERSION "1.0 by Dr.G"rn#define AUTHOR "AMXX DoD Team"rn////////////////////////////////////////////////////////////////////////////////////////////////////rn/* NOTE: */rn/* CBasePlayer::PreThink(void) -> Offset WIN32 = 132 */rnrn/* CBasePlayer::Spawn(void) -> Offset WIN32 = 3 */rnrn/* CBasePlayer::Killed(entvars_s *, int) -> Offset WIN32 = 20 */rnrn/* THESE are offsets for Day of Defeat! */rn////////////////////////////////////////////////////////////////////////////////////////////////////rnnew i[33] = 0rnnew time_to_run rnnew counter[33] = 0rnnew is_alive[33] = 0rn////////////////////////////////////////////////////////////////////////////////////////////////////rnpublic plugin_init() rn{rn rn register_plugin(PLUGIN, VERSION, AUTHOR)rn rn new OrpheuFunction:iThink = OrpheuGetFunctionFromClass("player", "PreThink", "CBasePlayer" )rn OrpheuRegisterHook(iThink,"think_Player")rn rn new OrpheuFunction:Player_Spawn = OrpheuGetFunctionFromClass("player", "Spawn", "CBasePlayer" )rn OrpheuRegisterHook(Player_Spawn,"Spawn")rn rn new OrpheuFunction:Player_Killed = OrpheuGetFunctionFromClass("player","Killed", "CBasePlayer" )rn OrpheuRegisterHook(Player_Killed,"player_Killed")rn rn time_to_run = register_cvar("time_to_run","30")rn rn register_clcmd("say /thinktest","start_Test")rn rn}rn////////////////////////////////////////////////////////////////////////////////////////////////////rnpublic start_Test(id)rn{rn set_task( get_pcvar_float(time_to_run), "stop_Test", id )rn counter[id] = 0rn}rn////////////////////////////////////////////////////////////////////////////////////////////////////rnpublic stop_Test(id)rn{rn client_print(id, 3, "*Thinks per Sec: %d", (counter[id]/get_pcvar_num(time_to_run)))rn}rn////////////////////////////////////////////////////////////////////////////////////////////////////rnpublic Spawn(player) //looks like its pre..rn{rn set_task(1.0, "Spawn_Delayed", player)rn}rn////////////////////////////////////////////////////////////////////////////////////////////////////rnpublic Spawn_Delayed(id)rn is_alive[id] = is_user_alive(id)rn////////////////////////////////////////////////////////////////////////////////////////////////////rnpublic think_Player(player)rn{rn counter[player]++rn rn rn if(i[player] == 600)rn {rn i[player] = 0rn rn if(is_alive[player])rn {rn client_print(player, 3, "*Thinkin' and alive..")rn returnrn }rn elsern client_print(player, 3, "*Thinkin' and dead..")rn rn }rn i[player]++rn rn}rn////////////////////////////////////////////////////////////////////////////////////////////////////rnpublic player_Killed(victim, killer, something)rn{rn is_alive[victim] = 0rn client_print(victim, 3, "*You died!")rn}rn////////////////////////////////////////////////////////////////////////////////////////////////////rnrnrnRef.: Orpheu: Using virtual functionsrnrnrn-Cheers!Threads: 103
Joined: May 2005
this is some interesting stuff youve found here... been browsing thru the threads about it on the amxx forums and it seems like this will open a whole ton of new possibilities
Threads: 75
Joined: Nov 2007
It sure will. joaquim andrade unlocked the CS:CZ's build in bots so they would work in CS haha. Its not really user friendly. But will for sure let us do alot of new stuff. I wonder if we somehow can get over the 512 model limit, that would be interessting...
Threads: 75
Joined: Nov 2007
BTW. If you wanna hook other stuff like CWEBLEY eg. you gotta add first in the dodaddonsamxmodxconfigsorpheu ypesCBaseEntityaliases just like all the other stuff that allready there. And ofcource you need the signatures for it. nBut you might wanna use CBasePlayerWeapon::vtbl insted, but its possible, and a good way to kill a single weapon, so no one can use it like grenades or what ever...
Threads: 103
Joined: May 2005
i only messed around with it for a few minutes.. and just with the simple string replacing stuff and whatnot
Threads: 3
Joined: Aug 2007
Is this better then Hamsandwich? I dont know, but its looks more stabil IMO.rnrnrnFrom what I gathered from the conversations if you can use Hamsandwich then you should becuase it has less overhead.
Threads: 75
Joined: Nov 2007
From what I gathered from the conversations if you can use Hamsandwich then you should becuase it has less overhead.rnrnYes, just read about it, thanks....

