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