Seifer wrote this cog to cause the player in jk mp to respawn on the last surface walked on. the only problem is that i have a verybasic knowledge of cog and i'm not sure how to implement it. anybody know how?
here's the code:
any help would be appreciated. thanks
here's the code:
Code:
killed:
dist = 10000;
curPos = GetThingPos(player);
for(i=0; i<GetSurfaceCount; i=i+1)
{
if(GetSurfaceFlags(i) & 0x1)
{
checker = VectorDist(curPos, SurfaceCenter(i));
if(checker < dist)
{
dist = checker;
closest = i;
floor = CreateThingAtPos(ghost,
GetSurfaceSector(closest), GetSurfaceCenter(closest),
'0 0 0');
}
}
}
}
newplayer:
TeleportThing(player, floor);
Destroything(floor);
any help would be appreciated. thanks
though not for this specific use.
, and no Emon ..... that is not the case, most of the time , you don't come near the pit bottom it self.![http://forums.massassi.net/html/confused.gif [http://forums.massassi.net/html/confused.gif]](http://forums.massassi.net/html/confused.gif)