SA-MP Forums Archive
How I can get more bots on my checkpoints - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How I can get more bots on my checkpoints (/showthread.php?tid=660322)



How I can get more bots on my checkpoints - Blackaslan - 31.10.2018

Well some bots are going to the checkpoint when is activated but is a small ammount so my question is how I can get more bots in the checkpoint

There is the code:

Code:
forward crearPuntoControl();
public crearPuntoControl()
{
	idPuntoActual = random(sizeof(puntosControl));
	foreach(new i : Player)
	{
		SendClientMessage(i, -1, getMensaje(i, "ANNOUNCE0"));
		SendClientMessage(i, -1, getMensaje(i, "ANNOUNCE1"));
		getMensajeA(i, "ANNOUNCE2", consulta, sizeof(consulta), lugarPunto[idPuntoActual]);
		SendClientMessage(i, -1, consulta);
		SendClientMessage(i, -1, getMensaje(i, "ANNOUNCE3"));
		SendClientMessage(i, ROJO_FF, getMensaje(i, "ANNOUNCE4"));
		SetPlayerCheckpoint(i, puntosControl[idPuntoActual][0], puntosControl[idPuntoActual][1], puntosControl[idPuntoActual][2], TAMANO_PUNTO);
	}
	new
        Float:pos_x,
        Float:pos_y,
        Float:pos_z;
	pos_x = puntosControl[idPuntoActual][0]; 
	pos_y = puntosControl[idPuntoActual][1];
	pos_z = puntosControl[idPuntoActual][2];
	for(new i = 1; i<=MAX_ZOMBIES-(MAX_ZOMBIES/7); i++)
	{
		if(FCNPC_IsValid(MAX_PLAYERS-i) && !FCNPC_IsStreamedForAnyone(MAX_PLAYERS-i))
		{
			FCNPC_SetPosition(i, pos_x, pos_y, pos_z);
			getMovementPosition(pos_x, pos_y, pos_z);
			FCNPC_GoTo(i, pos_x, pos_y, pos_z + 1.2, MOVE_TYPE_RUN, MOVE_SPEED_RUN);
		}
	}
}



Re: How I can get more bots on my checkpoints - TheToretto - 31.10.2018

pawn Code:
for(new i = 1; i<=MAX_ZOMBIES-(MAX_ZOMBIES/7); i++)
Obviously you have a limitation here, so disable it:

pawn Code:
for(new i = 1; i<=MAX_ZOMBIES; i++)



Re: How I can get more bots on my checkpoints - GTLS - 31.10.2018

Why not just use foreach to scroll through each player. You can tag your bots as Zombies.