- Joined
- May 4, 2013
- Messages
- 269
- Reaction score
- 129
Hello, I was seeing it on multiple servers (including mine) existed abuse the spawn protection, where the player unplugged in front and connected with protection, so I decided to make the players to disconnect return to spawn.
WarZ_Server.sln
ServerGameLogic.cpp
Find:
Make it look this:
Find:
And make it look this:
Compile in Release Build
PS: When the player character its revive is placed with Alive = 2, so we return to the nearest spawn, and we login to the map, is placed as Alive = 1. Thus, the function commented Alive = 1, he plugged in the same place, and add in Alive = 2, where returning to spawn If anything is missing, or found a bug, put in the comments so we can try to fix it together
Sorry for bad english
WarZ_Server.sln
ServerGameLogic.cpp
Find:
Code:
if(loadout.GameMapId && (loadout.GameMapId == ginfo_.mapId) && loadout.Alive == 1)
{
*pos = loadout.GamePos;
*dir = loadout.GameDir;
//r3dOutToLog("alive at position %f %f %f\n", pos->x, pos->y, pos->z);
return;
}
Make it look this:
Code:
/*if(loadout.GameMapId && (loadout.GameMapId == ginfo_.mapId) && loadout.Alive == 1)
{
*pos = loadout.GamePos;
*dir = loadout.GameDir;
//r3dOutToLog("alive at position %f %f %f\n", pos->x, pos->y, pos->z);
return;
}*/
Find:
Code:
if(loadout.GameMapId && loadout.Alive == 2)
{
GetSpawnPositionAfterDeath(loadout.GamePos, pos, dir);
// move spawn pos at radius
pos->x += u_GetRandom(-_glm_SpawnRadius, _glm_SpawnRadius);
pos->z += u_GetRandom(-_glm_SpawnRadius, _glm_SpawnRadius);
//r3dOutToLog("revived at position %f %f %f\n", pos->x, pos->y, pos->z);
return;
}
And make it look this:
Code:
if(loadout.GameMapId && loadout.Alive == 1 || loadout.Alive == 2)
{
GetSpawnPositionAfterDeath(loadout.GamePos, pos, dir);
// move spawn pos at radius
pos->x += u_GetRandom(-_glm_SpawnRadius, _glm_SpawnRadius);
pos->z += u_GetRandom(-_glm_SpawnRadius, _glm_SpawnRadius);
//r3dOutToLog("revived at position %f %f %f\n", pos->x, pos->y, pos->z);
return;
}
Compile in Release Build
PS: When the player character its revive is placed with Alive = 2, so we return to the nearest spawn, and we login to the map, is placed as Alive = 1. Thus, the function commented Alive = 1, he plugged in the same place, and add in Alive = 2, where returning to spawn If anything is missing, or found a bug, put in the comments so we can try to fix it together
Sorry for bad english