Raised This Month: $51 Target: $400
 12% 

Hamsandwich Updating


Post New Thread Closed Thread   
 
Thread Tools Display Modes
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 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 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-05-2012 , 02:27   Re: Hamsandwich Updating
#92

Quote:
Originally Posted by schmurgel1983 View Post
that feature are not pointless, this makes easier for cz bot support
What I meant was that it doesn't make any sense for a function that is based on classnames to be able to also work for one single instance where something does not have a classname.
__________________
fysiks is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 01-15-2012 , 15:03   Re: Hamsandwich Updating
#93

Wohoo!
So we have a sandwich with more ham now. Will test this.
Nice work!
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 01-15-2012 , 15:23   Re: Hamsandwich Updating
#94

Could you please fix Ham_BodyTarget.It still crashes(at least in CS it crashes).
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-15-2012 , 15:25   Re: Hamsandwich Updating
#95

Make sure you have well updated Ham and recompiled your plugin with the new includes. It's possible also there are some misaligned offsets.
__________________

Last edited by Arkshine; 01-15-2012 at 15:27.
Arkshine is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 01-16-2012 , 06:03   Re: Hamsandwich Updating
#96

I had updated HAM, I tested.Everything I tested works ok, except Ham_BodyTarget.
__________________


Last edited by NiHiLaNTh; 01-16-2012 at 06:03.
NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 01-18-2012 , 21:19   Re: Hamsandwich Updating
#97

Code:
public RespawnPlayer(id) {     if(get_pcvar_num(pCvar_Active))     {         if(!is_user_alive(id))         {             ExecuteHam(Ham_CS_RoundRespawn, id);             return HAM_SUPERCEDE;         }     }     return HAM_IGNORED; }

Code:
L 01/19/2012 - 00:17:52: Start of error session.
L 01/19/2012 - 00:17:52: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20120119.log")
L 01/19/2012 - 00:17:52: [HAMSANDWICH] Entity has null private data (1)
L 01/19/2012 - 00:17:52: [AMXX] Displaying debug trace (plugin "pug-respawn.amxx")
L 01/19/2012 - 00:17:52: [AMXX] Run time error 10: native error (native "ExecuteHam")
L 01/19/2012 - 00:17:52: [AMXX]    [0] pug-respawn.sma::RespawnPlayer (line 59)
I already trying this:
Code:
ExecuteHamB(Ham_CS_RoundRespawn, id);

Wtf this error?
__________________

Last edited by kramesa; 01-18-2012 at 21:26.
kramesa is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-18-2012 , 21:21   Re: Hamsandwich Updating
#98

Are you trying to execute Ham_Spawn in a Ham_Spawn forward? That doesn't sound right to me.
__________________
fysiks is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 01-18-2012 , 21:24   Re: Hamsandwich Updating
#99

Quote:
Originally Posted by fysiks View Post
Are you trying to execute Ham_Spawn in a Ham_Spawn forward? That doesn't sound right to me.
I trying to respawn a player.
__________________

Last edited by kramesa; 01-18-2012 at 21:24.
kramesa is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-18-2012 , 21:28   Re: Hamsandwich Updating
#100

Quote:
Originally Posted by kramesa View Post
I trying to respawn a player.
You removed the code that I was refering to so nevermind.
__________________

Last edited by fysiks; 01-18-2012 at 21:28.
fysiks is offline
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:17.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode