Raised This Month: $ Target: $400
 0% 

Orpheu - Problems with HAM - GiveAmmo - And what the hell is Think?


Post New Thread Reply   
 
Thread Tools Display Modes
bibu
Veteran Member
Join Date: Sep 2010
Old 08-08-2011 , 16:46   Re: Orpheu - Problems with HAM - GiveAmmo - And what the hell is Think?
Reply With Quote #11

Quote:
Originally Posted by sake View Post
Isn't Orpheu more efficient due to using native Cstrike functions? Or does the Cstrike module just do the same?
Just use the cstrike native. There isn't anything wrong with it.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-08-2011 , 17:11   Re: Orpheu - Problems with HAM - GiveAmmo - And what the hell is Think?
Reply With Quote #12

Quote:
Originally Posted by sake View Post
Isn't Orpheu more efficient due to using native Cstrike functions? Or does the Cstrike module just do the same?
You should not worry about that. Use just the available natives depending your needs. Talking efficiency for that is not worth and you waste time.

Ham_GiveAmmo calls CBasePlayer::GiveAmmo. Unless you have a good reason, Ham is more easy.

Before trying to use these functions, check before what they do, such function for example can be seen in the HLDSK :

PHP Code:
int CBasePlayer::GiveAmmoint iCountchar *szNameint iMax )
{
    if( 
pev->flags FL_SPECTATOR || !szName || !g_pGameRules->CanHaveAmmothisszNameiMax ) )
    {
        return -
1;
    }

    
int i 0;

    
GetAmmoIndexszName );

    if( 
|| >= MAX_AMMO_SLOTS )
    {
        return -
1;
    }

    
int iAdd miniCountiMax m_rgAmmo[i] );

    if( 
iAdd )
    {
        return 
i;
    }

    
m_rgAmmo] += iAdd;

    if( 
gmsgAmmoPickup )  // make sure the ammo messages have been linked first
    
{
        
MESSAGE_BEGINMSG_ONEgmsgAmmoPickupNULLENTpev ) );
            
WRITE_BYTEGetAmmoIndex(szName) );        // ammo ID
            
WRITE_BYTEiAdd );        // amount
        
MESSAGE_END();
    }

    
TabulateAmmo();

    return 
i;



PHP Code:
BOOL CGameRules::CanHaveAmmoCBasePlayer *pPlayer, const char *pszAmmoNameint iMaxCarry )
{
    
int iAmmoIndex;

    if ( 
pszAmmoName )
    {
        
iAmmoIndex pPlayer->GetAmmoIndexpszAmmoName );

        if ( 
iAmmoIndex > -)
        {
            if ( 
pPlayer->AmmoInventoryiAmmoIndex ) < iMaxCarry )
            {
                
// player has room for more of this type of ammo
                
return TRUE;
            }
        }
    }

    return 
FALSE;



The native cs_set_user_bpammo sets only the m_rgAmmo offset.
__________________

Last edited by Arkshine; 08-08-2011 at 17:13.
Arkshine is offline
sake
Senior Member
Join Date: Jul 2011
Old 08-08-2011 , 18:47   Re: Orpheu - Problems with HAM - GiveAmmo - And what the hell is Think?
Reply With Quote #13

The original reason why I did this is that I think that using Hamsandwich 1.81 with AMXModX 1.76 isn't save. And I want to be as backwards compatible as I can. But if Hamsandwich just does the same as Orpheu that's ok, isn't it?
__________________

Last edited by sake; 08-08-2011 at 18:54.
sake is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-08-2011 , 19:49   Re: Orpheu - Problems with HAM - GiveAmmo - And what the hell is Think?
Reply With Quote #14

HamSandwich can be added just as easily as Orpheu can be added.
In fact, HamSandwich is an easier installation.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-08-2011 , 20:05   Re: Orpheu - Problems with HAM - GiveAmmo - And what the hell is Think?
Reply With Quote #15

Quote:
Originally Posted by sake View Post
Hello there,

Would it be a problem, if I do sth like this:

PHP Code:
ExecuteHam(Ham_GiveAmmoid200"50ae"200); 
If the weapon has a maximum Ammo count of 35? (In this case it's the Deagle).
Code would work fine, but why don't try before you ask ? ;)
( Change Deagle Max BpAmmo THERE )
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 08-08-2011 at 20:07.
ConnorMcLeod is offline
sake
Senior Member
Join Date: Jul 2011
Old 08-09-2011 , 03:02   Re: Orpheu - Problems with HAM - GiveAmmo - And what the hell is Think?
Reply With Quote #16

Quote:
Originally Posted by ConnorMcLeod View Post
Code would work fine, but why don't try before you ask ? ;)
( Change Deagle Max BpAmmo THERE )
As I already said, I did. And it worked. I just wanted to reassure that it wouldn't crash
__________________
sake is offline
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 06:43.


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