Declaration Error!

M making a small project. Adding some extra values but getting declaration error. I declared the corect values still it shows me same errors. m posting my code and errors. Just check it and tell me where to declare the object. This is small part of my project code where m getting errors.

Zcharacter.cpp:

void ZCharacter::OnDamagedAPlayer(ZObject* pAttacker, rvector srcPos, ZDAMAGETYPE damageType, MMatchWeaponType weaponType, float fDamage, float fPiercingRatio, int nMeleeTpye)
{
if (damageType == ZD_MELEE)
{
OnDamaged(pAttacker, srcPos, damageType, weaponType, fDamage, fPiercingRatio, nMeleeTpye);
return;
}

if (pAttacker != NULL && fDamage > 0)
{
if (pAttacker == ZGetGame()->m_pMyCharacter && this != pAttacker && !ZGetGame()->m_pMyCharacter->IsDie())
{
void* pBlobArray = MMakeBlobArray(sizeof(MTD_ShotInfo), 1);
void* pBlobElement = MGetBlobArrayElement(pBlobArray, 0);

MTD_ShotInfo shotInfo;
shotInfo.fDamage = fDamage;
shotInfo.fPosX = srcPos.x;
shotInfo.fPosY = srcPos.y;
shotInfo.fPosZ = srcPos.z;
shotInfo.nDamageType = damageType;
shotInfo.fRatio = fPiercingRatio;
shotInfo.nLowId = GetUID().Low;
shotInfo.nWeaponType = weaponType;

memcpy(pBlobElement, &shotInfo, sizeof(MTD_ShotInfo));
ZGetGameClient()->GetPeerPacketCrypter().Encrypt((char*)pBlobElement, sizeof(MTD_ShotInfo));
ZPOSTCMDLEAD(MC_GUNZ_ANTILEAD, GetUID(), MCommandParameterBlob(pBlobArray, MGetBlobArraySize(pBlobArray)));
}
}
}

void ZCharacter::OnDamagedAPlayer(vector<MTD_ShotInfo*> vShotInfo)
{
if (vShotInfo.size() > 0)
{
if (ZGetGameClient()->GetPlayerUID().Low != GetUID().Low)
{
void* pBlobArray = MMakeBlobArray(sizeof(MTD_ShotInfo), vShotInfo.size());

for (int i = 0; i < vShotInfo.size(); ++i)
{
MTD_ShotInfo* pShot = vShotInfo[i];
void* pElement = MGetBlobArrayElement(pBlobArray, i);
memcpy(pElement, pShot, sizeof(MTD_ShotInfo));
ZGetGameClient()->GetPeerPacketCrypter().Encrypt((char*)pElement, sizeof(MTD_ShotInfo));
}

ZPOSTCMDLEAD(MC_GUNZ_ANTILEAD, GetUID(), MCommandParameterBlob(pBlobArray, MGetBlobArraySize(pBlobArray)));
}
}
}





ZCharacter.h:

/// ij¸¯ÅÍ Å¬·¡½º
class ZCharacter : public ZCharacterObject
{
MDeclareRTTI;
void OnDamagedAPlayer;
//friend class ZCharacterManager;
private:
protected:

// ¸ðµâµé. Çѹø »ý¼ºµÇ°í ¼Ò¸êµÉ¶§ °°ÀÌ Áö¿î´Ù
ZModule_HPAP *m_pModule_HPAP;
ZModule_QuestStatus *m_pModule_QuestStatus;
ZModule_Resistance *m_pModule_Resistance;
ZModule_FireDamage *m_pModule_FireDamage;
ZModule_ColdDamage *m_pModule_ColdDamage;
ZModule_PoisonDamage *m_pModule_PoisonDamage;
ZModule_LightningDamage *m_pModule_LightningDamage;
ZModule_HealOverTime *m_pModule_HealOverTime;


ZCharacterProperty m_Property; ///< HP µîÀÇ Ä³¸¯ÅÍ ¼Ó¼º
MProtectValue<ZCharacterStatus> m_Status; ///< Ç÷¹ÀÌ¾î »óÅ°ª

MProtectValue<MTD_CharInfo> m_MInitialInfo; ///< ij¸¯ÅÍ ÃʱâÁ¤º¸


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// °ÔÀÓ ¾È¿¡¼­ÀÇ Äɸ¯ÅÍ ¹öÇÁ °ü·Ã Á¤º¸ ¹× ÇÔ¼ö
protected:
//¹öÇÁÁ¤º¸ÀÓ½ÃÁÖ¼® ZCharacterBuff m_CharacterBuff; ///< Àû¿ëµÇ°í ÀÖ´Â ¹öÇÁ

float m_fPreMaxHP;
float m_fPreMaxAP;

public:
//¹öÇÁÁ¤º¸ÀÓ½ÃÁÖ¼®

void SetCharacterBuff(MTD_CharBuffInfo* pCharBuffInfo);
ZCharacterBuff* GetCharacterBuff() { return &m_CharacterBuff;}



void ApplyBuffEffect();

float GetMaxHP();
float GetMaxAP();
float GetHP();
float GetAP();
void InitAccumulationDamage();
float GetAccumulationDamage();
void EnableAccumulationDamage(bool bAccumulationDamage);

__forceinline void SetMaxHP(float nMaxHP) { m_pModule_HPAP->SetMaxHP(nMaxHP); }
__forceinline void SetMaxAP(float nMaxAP) { m_pModule_HPAP->SetMaxAP(nMaxAP); }

__forceinline void SetHP(float nHP) { m_pModule_HPAP->SetHP(nHP); }
__forceinline void SetAP(float nAP) { m_pModule_HPAP->SetAP(nAP); }

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

protected:
MProtectValue<ZUserAndClanName>* m_pMUserAndClanName; ///< ij¸¯¸í,Ŭ·£¸í

struct KillInfo {
int m_nKillsThisRound; ///< À̹ø¶ó¿îµå¿¡¼­ÀÇ kills ( unbelievable ÆÇÁ¤)
float m_fLastKillTime; ///< ¸¶Áö¸·¿¡ Á×ÀÎ ½Ã°£ (excellent)¸¦ Ç¥½ÃÇϱâ À§ÇÔ
};
MProtectValue<KillInfo> m_killInfo;

struct DamageInfo {
DWORD m_dwLastDamagedTime; // ¸¶Áö¸·À¸·Î °ø°Ý ¹ÞÀº ½Ã°£
ZSTUNTYPE m_nStunType; ///< ¸Â´Â ¾Ö´Ï¸ÞÀÌ¼Ç Á¾·ù.. 2:¸¶Áö¸·Å¸°Ý,4:lightning,5:·çÇÁ
ZDAMAGETYPE m_LastDamageType; ///< ¸¶Áö¸· µ¥¹ÌÁö ŸÀÔ
MMatchWeaponType m_LastDamageWeapon; ///< ¸¶Áö¸· µ¥¹ÌÁö ¹«±â..
rvector m_LastDamageDir; ///< ¸¶Áö¸· µ¥¹ÌÁö ¹æÇâ ( Á×´Â ¸ð¼ÇÀ» °áÁ¤ )
float m_LastDamageDot;
float m_LastDamageDistance;

MUID m_LastThrower; ///< ¸¶Áö¸· ¶ç¿î »ç¶÷
float m_tmLastThrowClear; ///< ¸¶Áö¸· ¶ç¿î »ç¶÷ Àؾ µÇ´Â½Ã°£
};
MProtectValue<DamageInfo> m_damageInfo;

int m_nWhichFootSound; ///< ¹ß¼Ò¸®¸¦ ¹ø°¥¾Æ ³»±âÀ§ÇØ ¾î´À ¹ßÀÎÁö ÀúÀåÇÑ º¯¼ö

MProtectValue<DWORD>* m_pMdwInvincibleStartTime; // ¹«ÀûÀÇ ½ÃÀÛ ½Ã°£
MProtectValue<DWORD>* m_pMdwInvincibleDuration; // ¹«ÀûÀÇ Áö¼Ó½Ã°£

virtual void UpdateSound();

void InitMesh(); ///< ij¸¯ÅÍ ÆÄÃ÷ µîÀÇ ¸Þ½¬Á¤º¸ ¼¼ÆÃ. InitCharInfo¿¡¼­ È£Ãâ


void InitProperties();

// float m_fIconStartTime[ZCI_END]; ///< ¸Ó¸®À§¿¡ ¶ß´Â ¾ÆÀÌÄܵé

void CheckLostConn();
virtual void OnLevelDown();
virtual void OnLevelUp();
virtual void OnDraw();
// virtual void RegisterModules();
virtual void OnDie();

void ShiftFugitiveValues();

public:
float m_fLastValidTime; // Dead Reckoning¿¡ ÇÊ¿äÇÑ º¯¼ö -> Áö±Ý Äڵ忡¼­ ÇÊ¿ä¾ø¾îº¸ÀÓ
DWORD m_dwIsValidTime; //µð¹ö±× ·¹Áö½ºÅÍ ÇØÅ· ¹æ¾î¸¦ À§ÇÑ Å¸ÀÓ Ã¼Å©..°­º£±âÂÊ..

// float m_fDistToFloor; // ¹Ù´Ú±îÁöÀÇ °Å¸®
// rplane m_FloorPlane; // ¹Ù´Ú Æò¸éÀÇ ¹æÁ¤½Ä
// float m_fFallHeight; // ³«ÇÏ°¡ ½ÃÀÛµÈ ½ÃÁ¡

MProtectValue<ZCharaterStatusBitPacking> m_dwStatusBitPackingValue; // ¾ê´Â Àΰ£ÀûÀ¸·Î crcüũ±îÁø ¸øÇÏ°Ú´Ù...;;

//mmemory proxy
MProtectValue<bool>* m_bCharged;
MProtectValue<bool>* m_bCharging;



MProtectValue<float> m_fChargedFreeTime; // Èû¸ðÀÎ°Ô Ç®¸®´Â ½Ã°£
MProtectValue<int> m_nWallJumpDir; // º®Á¡ÇÁÇÏ´Â ¹æÇâ
MProtectValue<int> m_nBlastType; // ´Üµµ°è¿­Ãß°¡~


ZC_STATE_LOWER m_SpMotion;






ERRORS:

ZCharacter.cpp
ZCharacter.cpp(2953) : warning C4800: 'const char *' : forcing value to bool 'true' or 'false' (performance warning)
ZCharacter.cpp(3071) : warning C4800: 'FLOAT' : forcing value to bool 'true' or 'false' (performance warning)
ZCharacter.cpp(4414) : error C2039: 'OnDamagedAPlayer' : is not a member of 'ZCharacter'
f:\Gunz\Stable\Gunz\ZCharacter.h(358) : see declaration of 'ZCharacter'
ZCharacter.cpp(4418) : error C3861: 'OnDamaged': identifier not found, even with argument-dependent lookup
ZCharacter.cpp(4424) : error C2673: 'OnDamagedAPlayer' : global functions do not have 'this' pointers
ZCharacter.cpp(4436) : error C2228: left of '.Low' must have class/struct/union type
type is ''unknown-type''
ZCharacter.cpp(4436) : error C3861: 'GetUID': identifier not found, even with argument-dependent lookup
ZCharacter.cpp(4441) : error C3861: 'GetUID': identifier not found, even with argument-dependent lookup
ZCharacter.cpp(4446) : error C2039: 'OnDamagedAPlayer' : is not a member of 'ZCharacter'
f:\Gunz\Stable\Gunz\ZCharacter.h(358) : see declaration of 'ZCharacter'
ZCharacter.cpp(4450) : error C2228: left of '.Low' must have class/struct/union type
type is ''unknown-type''
ZCharacter.cpp(4450) : error C3861: 'GetUID': identifier not found, even with argument-dependent lookup
ZCharacter.cpp(4452) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data
ZCharacter.cpp(4454) : warning C4018: '<' : signed/unsigned mismatch
ZCharacter.cpp(4462) : error C3861: 'GetUID': identifier not found, even with argument-dependent lookup



Check it out and tell me the solution! Thank you!
What is it?

void OnDamagedAPlayer;
I declared it ! But its not working!
What did you declare?! One more What is it?

void OnDamagedAPlayer;
That declaration is wrong buddy..i forgot to erase it. Please tell me where to declare exactly./
This error message

ZCharacter.cpp(4414) : error C2039: 'OnDamagedAPlayer' : is not a member of 'ZCharacter'
f:\Gunz\Stable\Gunz\ZCharacter.h(358) : see declaration of 'ZCharacter'

is very clear says that you did not declare this function.
Tell me the declaration. Declaration with syntaxx. and where should i put..i did all options that i know..please let me know where to exactly declare it!
I think it is not your program. Why do not you ask questions the author of the program?
Author offline for 15 days. no contact with him and i need urgent support.can u help ?
You defined two overloaded functions

void ZCharacter::OnDamagedAPlayer(ZObject* pAttacker, rvector srcPos, ZDAMAGETYPE damageType, MMatchWeaponType weaponType, float fDamage, float fPiercingRatio, int nMeleeTpye);

and


void ZCharacter::OnDamagedAPlayer(vector<MTD_ShotInfo*> vShotInfo);

But theay are not declared in class ZCharacter. Instead of them you declared (it is invalid declaratrion) the following variable

void OnDamagedAPlayer;

kk gotcha thanks!~
Topic archived. No new replies allowed.