I know that here are the best ones, and that they help me with this.
I would like you to help me with a syntax.
Currently there are many "respawn" plugins, each with certain different qualities, some help respawn the survivors through the menu or a command, others have an automatic respawn, making one survivor appear next to another, and others that make the survivors respawn at the start of the game.
What I want is for a dead survivor to respawn anywhere on the map, but never close to a partner, or perhaps to make them appear in certain locations, or in the RESCUE_CLOSET zones of the NAV.
Well, what I am using now is that they appear close to their classmates, and I did it in the following way:
PHP Code:
public Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event,"userid"));
if (isRespawn && IsValidClient(client) && GetClientTeam(client) == 2)
{
ForcePlayerSuicide(client);
RespawnTimer[client] = CreateTimer(GetConVarFloat(l4dm_autorespawn_timeout), Timer_Respawn, client);
}
}
public Action:Timer_Respawn(Handle:timer, any:client)
{
if (IsValidClient(client))
{
SDKCall(hRoundRespawn, client);
decl Float:position[3], Float:anglestarget[3];
new any:target = FindNewTarget(client, teleporttarget[client]);
if (!IsClientInGame(target)) target = FindNewTarget(client, 1);
if (target == client) target = FindNewTarget(client, target);
GetClientAbsOrigin(target, position);
GetClientAbsAngles(target, anglestarget);
TeleportEntity(client, position, anglestarget, NULL_VECTOR);
}
}