Hi, im working on a Plugin for a Deathmatch mode for the game contagion.
To block the round from ending @ low playercount i will use Bots(i will use Hunted as gammode = last man Standing).
Now i got them joining but when they die, they are not respawning on the map. The Event gets triggered because all Players will respawn as Spectator or Zombie. In the respawnSurvivorInit(), the client Team is set to survivors, and the Client get some weapons. After this the Players are respawning on the map, the bot not.
So i kicked the bots and added them again.
Here is my Code for the Playerspawn Event:
PHP Code:
public Event_PlayerSpawn( Handle:event, const String:szEventName[], bool:bDontBroadcast ) {
//Players
new client = GetClientOfUserId(GetEventInt(event, "userid"));
if ((0 < client <= MaxClients ) && !IsFakeClient(client)) {
respawnSurvivorInit(client);
cleanAmmo();
}
//BOT
if ((0 < client <= MaxClients ) && IsFakeClient(client) && (GetClientTeam(client) != PLAYER_SURVIVOR_ID)) {
KickClient(client);
RemoveEntity(client);
int client2 = CreateFakeClient("Dont let me Win");
respawnSurvivorInit(client2);
DispatchSpawn(client2);
SetEntityModel(client2, "models/player/cockroach.mdl");
SetEntData(client2, FindDataMapInfo(client2, "m_iHealth"), 40000, 4, true);
}
}
Is there a more elegant way to respawn the bot?
Greetings
__________________