Thread
:
Hamsandwich Updating
View Single Post
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
01-05-2012 , 01:43 Re: Hamsandwich Updating
#
91
That code you posted is too much for a so little thing.
What I would do would be:
Register all them in the spawn and disable them afterwards and enable them where I would do the normal Register.
Or if you want to have it more normal, create a module that creates a bot with server commands before plugin loading, gets the virtual table of the bot, creates a imitation of in instance of a CSSBot class just with the virtual table pointer in the same place, and provide a native to plugins to get the address of that imitation like
get_fake_bot()
.
Then you would do
RegisterHamFromEntity
(
get_fake_bot
(),...) (Anywhere)
Like:
When you create a bot you will have a CCSBot object.
Get that object address hooking its spawn or whatever.
Get that object virtual table pointer.
Create a dummy object and set its virtual table pointer to point to the virtual table of the bot.
Now you will have a permanent dummy object for the rest of the server that will never be destroyed and can be used the same with
RegisterHamFromEntity
as if it were a bot.
That's the best I can think of.
Last edited by joaquimandrade; 01-05-2012 at
01:45
.
joaquimandrade
View Public Profile
Send a private message to joaquimandrade
Find More Posts by joaquimandrade