GunZ Item Call C++

Results 1 to 8 of 8
  1. #1
    In Progress... FFXIV... Anju is offline
    MemberRank
    Oct 2010 Join Date
    Mist Ward 7 #38Location
    1,946Posts

    GunZ Item Call C++

    I honestly didn't know what to title this topic.

    But anyways, the reason I posted this topic is to know how do you get the item type in C++ (client side).

    For example,

    Code:
    if(currentWeaponType == "shotgun")
    {
    // codes here
    } else if(currentWeaponType == "rifle")
    // code here
    }
    What I am trying to get is the weapon type while the player is playing (game play).
    Sorry if this doesn't make any sense. I've been on a lot of stress trying to figure this out.


  2. #2
    Alpha Member Chrisss is offline
    MemberRank
    Feb 2012 Join Date
    Ask the Fox!Location
    1,660Posts

    Re: GunZ Item Call C++

    You could use a switch tag for this
    Last edited by Chrisss; 10-08-13 at 07:46 PM.

  3. #3
    Good Guy George qet123 is offline
    MemberRank
    Apr 2009 Join Date
    DesertLocation
    1,432Posts

    Re: GunZ Item Call C++

    You mean if he's playing with shotgun print shotgun?

  4. #4
    I like pie OJuice is offline
    MemberRank
    Jul 2011 Join Date
    205Posts

    Re: GunZ Item Call C++

    Maybe something like this? not exactly prob, I dont fully understand what ur saying
    Code:
    switch(pItemDesc->m_nWeaponType.Ref()) {
    	case MWT_SHOTGUN:
                  // code
                  break;
            case MWT_RIFLE:
                  // code
                  break;
    }

  5. #5
    In Progress... FFXIV... Anju is offline
    MemberRank
    Oct 2010 Join Date
    Mist Ward 7 #38Location
    1,946Posts

    Re: GunZ Item Call C++

    Pretty much. Trying something out with the crosshair.

  6. #6
    I like pie OJuice is offline
    MemberRank
    Jul 2011 Join Date
    205Posts

    Re: GunZ Item Call C++

    so like this?

    WeaponScreenEffect.cpp
    Code:
    void ZWeaponScreenEffect::Draw(MDrawContext* pDC)
    {
    	return;
    
    	switch (m_nWeaponType)
    	{
    	case MWT_SHOTGUN:
                    // code
    		break;
            case MWT_RIFLE:
                    // code
    		break;
    	}
    }
    Or these maybe u could mess with?
    Code:
    void ZWeaponScreenEffect::OnGadget(MMatchWeaponType nWeaponType)
    {
    	return;
    
    	if (m_nWeaponType == nWeaponType) return;
    	if (m_nWeaponType != MWT_NONE) OnGadgetOff();
    
    	InitWeapon(nWeaponType);
    	m_nWeaponType = nWeaponType;
    }
    
    void ZWeaponScreenEffect::OnGadgetOff()
    {
    	return;
    
    	FinalWeapon(m_nWeaponType);
    	m_nWeaponType = MWT_NONE;
    }
    Last edited by OJuice; 10-08-13 at 08:02 PM.

  7. #7
    Valued Member a1tl4 is offline
    MemberRank
    Sep 2012 Join Date
    BrazilLocation
    112Posts

    Re: GunZ Item Call C++

    PHP Code:
    void Test()
    {
        
    ZItempSelectedItem ZGetGame()->m_pMyCharacter->GetItems()->GetSelectedWeapon();
        if( !
    pSelectedItem ) return;

        
    MMatchWeaponType wtype MWT_NONE;
            
        if(
    pSelectedItem->GetDesc() != NULL)
            
    wtype pSelectedItem->GetDesc()->m_nWeaponType.Ref();

        if( 
    wtype == MWT_SHOTGUN /*example*/ ){
             
    //code here
        
    }else if( wtype == MWT_RIFLE ){
             
    //code here
        
    }

    You could add as ZMyCharacter::Test and execute in same local where is running the functions of ZMyCharacter or simply make thread with loop.
    If you still don't know how to do, tell me.
    Last edited by a1tl4; 10-08-13 at 11:22 PM.

  8. #8
    In Progress... FFXIV... Anju is offline
    MemberRank
    Oct 2010 Join Date
    Mist Ward 7 #38Location
    1,946Posts

    Re: GunZ Item Call C++

    Thank you, a1tl4.



Advertisement