[help] spawning a creature

Hello guys,

I am having a problem, I am trying to spawn a creature through C++ to also get the pointer to that creature without having to calling a function for it, so I looked up the .npc add command and let that guide me, though my worldserver is still crashing when I call the function I made that spawns a creature, this is what I have :

Creature * me = new Creature; 



Map* map= sMapMgr->FindMap(1,0);

me->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, 1, 60000, 0, 35, -3774.096924f, 1096.924805f, 131.969269f, 6.176457f);


me->SaveToDB(map->GetId(), map->GetSpawnMode(), 1);


Any suggestions to fix this or another way to spawn a creature?


aha, the summoncreature method works as a spawn?