This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Module: Orpheu (v2.6.3)


Post New Thread Reply   
 
Thread Tools Display Modes
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 09-17-2011 , 11:23   Re: Module: Orpheu2.3a
Reply With Quote #811

Quote:
Originally Posted by Garufa View Post
In `function.cpp' is defined the following array of pointers to chars:

PHP Code:
unsigned char *PreJumps[0xFFFF]; 
... and then stores the result of `malloc' here:

PHP Code:
void Function::preparePatch()
{
    
unsigned charpreJump PreJumps[id] = (unsigned char*) malloc(PreJumpSize);

    ... 
... but this is used anymore. This is an increase of 256 MB of RAM in vain. I'm right?

EDIT: 0xFFFF = 65535 bytes, 65535 * 4 ( sizeof pointer in 32 bits machine ) = 262140 bytes, 262140 / 1024 = 256 MB
256KB you mean? I remember that when I wrote that it had an purpose but I guess I changed ideas in the middle of the thing.
joaquimandrade is offline
Garufa
Junior Member
Join Date: Sep 2011
Location: home/Garufa/
Old 09-17-2011 , 11:41   Re: Module: Orpheu2.3a
Reply With Quote #812

Quote:
Originally Posted by joaquimandrade View Post
256KB you mean? I remember that when I wrote that it had an purpose but I guess I changed ideas in the middle of the thing.
Yes, KB. MB was very crazy!. I guess it isn't a big waste of memory. I'm sorry .
Garufa is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 10-02-2011 , 07:21   Re: Module: Orpheu2.3a
Reply With Quote #813

I thought i've asked this before but i can't seem to find the thread or solution.

So i'm trying to hook some functions from class CSSBotManager but it always said:
Code:
		Parsing folder "CCSBotManager" started
			Parsing file "AddBot" started
				Class type not registered
				FAILED
			Parsing file "AddBot" ended
			Parsing file "AddServerCommands" started
				Class type not registered
				FAILED
			Parsing file "AddServerCommands" ended
		Parsing folder "CCSBotManager
EDIT: I've tried this but it didn't work
http://forums.alliedmods.net/showpos...&postcount=329
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-02-2011 , 10:48   Re: Module: Orpheu2.3a
Reply With Quote #814

Inside types/long/aliases/, make sure you have a file named CCSBotManager with the content :
Code:
[
    "CCSBotManager *"
]
__________________
Arkshine is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 10-02-2011 , 11:40   Re: Module: Orpheu2.3a
Reply With Quote #815

Works, thanks.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 10-30-2011 , 13:41   Re: Module: Orpheu2.3a
Reply With Quote #816

Hi!
I've added new ammo type (ammo ID 15) by using WeaponList thing and used m_rgAmmo_player_Slot0 offset + 15.

But I can't get this new ammo type to be shown in AmmoPickup message.

I was looking through HLSDK and found that all ammo types should be registered in AddAmmoNameToAmmoRegistry

Code:
void AddAmmoNameToAmmoRegistry( const char *szAmmoname )
{
    // make sure it's not already in the registry
    for ( int i = 0; i < MAX_AMMO_SLOTS; i++ )
    {
        if ( !CBasePlayerItem::AmmoInfoArray[i].pszName)
            continue;

        if ( _stricmp( CBasePlayerItem::AmmoInfoArray[i].pszName, szAmmoname ) == 0 )
            return; // ammo already in registry, just quite
    }


    giAmmoIndex++;
    ASSERT( giAmmoIndex < MAX_AMMO_SLOTS );
    if ( giAmmoIndex >= MAX_AMMO_SLOTS )
        giAmmoIndex = 0;

    CBasePlayerItem::AmmoInfoArray[giAmmoIndex].pszName = szAmmoname;
    CBasePlayerItem::AmmoInfoArray[giAmmoIndex].iId = giAmmoIndex;   // yes, this info is redundant
}
and later saved into array.

So I was thinking to call this function with Orpheu, but I dont know how to do it, since it seems that this function doesn't belong to any class(neither CBaseWeapon, nor CBasePlayerItem).
__________________


Last edited by NiHiLaNTh; 10-30-2011 at 13:42.
NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-30-2011 , 16:06   Re: Module: Orpheu2.3a
Reply With Quote #817

There is no difficulties. A function without class is put in functions/ and in the file, you don't provide the class. That's all.
__________________
Arkshine is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 10-30-2011 , 16:16   Re: Module: Orpheu2.3a
Reply With Quote #818

No, I was trying to say, how to call it in plugin.

PHP Code:
new g_pPointer;
....

public 
plugin_precache( )
{
        
// you need to pass class name as an 2nd argument, right?
        
g_pPointer OprheuFunction"AddAmmoNameToAmmoRegistry", ?(what class to add here?

        
// now call it
        
OrpheuCallSuperg_pPointer"40mm" );

__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-30-2011 , 17:33   Re: Module: Orpheu2.3a
Reply With Quote #819

No class = Nothing to write. You should learn to test yourself. Also I'm sure you could have find few examples by searching.
__________________

Last edited by Arkshine; 10-30-2011 at 17:34.
Arkshine is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 10-31-2011 , 12:03   Re: Module: Orpheu2.3a
Reply With Quote #820

Sorry, for bothering you again but I have one more problem. OK I tested it but it throws me an run-time error:

Quote:
L 10/31/2011 - 17:58:25: [ORPHEU] Invalid parameters count. Expected [1]. Got [2]
L 10/31/2011 - 17:58:25: [AMXX] Displaying debug trace (plugin "test.amxx")
L 10/31/2011 - 17:58:25: [AMXX] Run time error 10: native error (native "OrpheuCallSuper")
I don't get it - I passed only one param.

PHP Code:
new OrpheuFunction:g_pPointer;

public 
plugin_precache( )
{
    
g_pPointer OrpheuGetFunction"AddAmmoNameToAmmoRegistry" );
    
    
OrpheuCallSuperg_pPointer"5x45mm" ); 
Here is the console output

PHP Code:

Orpheu functions search started
.

    
Parsing functions started.
        
Parsing file "AddAmmoNameToAmmoRegistry" started
                
Function is updated
        Parsing file 
"AddAmmoNameToAmmoRegistry" ended 
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
Reply



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 21:59.


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