Advertisement
dcomicboy

create player

Jul 7th, 2012
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. CPlayerObj* CTO2GameServerShell::CreatePlayer(HCLIENT hClient, ModelId ePlayerModelId )
  2. {
  3. ObjectCreateStruct theStruct;
  4. INIT_OBJECTCREATESTRUCT(theStruct);
  5.  
  6. theStruct.m_Rotation.Init();
  7. VEC_INIT(theStruct.m_Pos);
  8. theStruct.m_Flags = 0;
  9.  
  10. HCLASS hClass = g_pLTServer->GetClass("CPlayerObj");
  11.  
  12. GameStartPoint* pStartPoint = FindStartPoint(LTNULL);
  13. if (pStartPoint)
  14. {
  15. g_pLTServer->GetObjectPos(pStartPoint->m_hObject, &(theStruct.m_Pos));
  16. }
  17.  
  18. CPlayerObj* pPlayer = NULL;
  19. if (hClass)
  20. {
  21. theStruct.m_UserData = ePlayerModelId; //pStartPoint->GetPlayerModelId();
  22. pPlayer = (CPlayerObj*) g_pLTServer->CreateObject(hClass, &theStruct);
  23. }
  24.  
  25. return pPlayer;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement