Clone of PhatAC @ https://github.com/floaterxk/PhatAC

Sign.cpp 865B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #include "StdAfx.h"
  2. #include "PhysicsObj.h"
  3. #include "sign.h"
  4. //To send server text.
  5. #include "BinaryWriter.h"
  6. #include "ChatMsgs.h"
  7. //This is getting a bit redundant.
  8. #include "Monster.h"
  9. #include "Player.h"
  10. CBaseSign::CBaseSign()
  11. {
  12. m_dwModel = 0x02000610;
  13. m_fScale = 1.0f;
  14. m_PhysicsState = PhysicsState::GRAVITY_PS | PhysicsState::IGNORE_COLLISIONS_PS | PhysicsState::REPORT_COLLISIONS_PS;
  15. m_strName = "Sign";
  16. m_wTypeID = 0x1139;
  17. m_wIcon = 0x12D3;
  18. m_ItemType = TYPE_MISC;
  19. }
  20. void CBaseSign::Precache()
  21. {
  22. //Load entity settings (location, and dynamic properties.)
  23. }
  24. void CBaseSign::Use(CPhysicsObj *pEntity)
  25. {
  26. if (pEntity->IsPlayer())
  27. {
  28. BinaryWriter *ST = ServerText("You clicked a sign, but the code isn't done yet .. so too bad!", 1);
  29. ((CBasePlayer *)pEntity)->SendNetMessage(ST->GetData(), ST->GetSize(), PRIVATE_MSG);
  30. delete ST;
  31. }
  32. }