SA-MP Forums Archive
[Pedido] Spawn Gangs - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Pedido] Spawn Gangs (/showthread.php?tid=627374)



Spawn Gangs - RazorSharpz - 27.01.2017

queria saber como faзo para tal gang ter spawns aleartorios por exemplo: a gang groove vгo spawnar em locais aleartorios na base deles enquanto a gang ballas vai spawnar em locais aleartorios na base deles.


Re: Spawn Gangs - G4M30V3R - 27.01.2017

Adapte, claro. '--'

Код:
new Float:SpawnOrg1[][] =
{
	{0.0, 0.0, 0.0},
	{0.0, 0.0, 0.0},
	{0.0, 0.0, 0.0},
	{0.0, 0.0, 0.0},
	{0.0, 0.0, 0.0}
	//Add mais se tiver
};

new Float:SpawnOrg2[][] =
{
	{0.0, 0.0, 0.0},
	{0.0, 0.0, 0.0},
	{0.0, 0.0, 0.0},
	{0.0, 0.0, 0.0},
	{0.0, 0.0, 0.0}
	//Add mais se tiver
};

new Float:SpawnOrg3[][] =
{
	{0.0, 0.0, 0.0},
	{0.0, 0.0, 0.0},
	{0.0, 0.0, 0.0},
	{0.0, 0.0, 0.0},
	{0.0, 0.0, 0.0}
	//Add mais se tiver
};

new PlayerOrg[MAX_PLAYERS]; // Variбvel da Org (adapte а sua)

public OnPlayerSpawn(playerid)
{
	switch(PlayerOrg[playerid])
	{
		case 0:
		{
			new rnd = random(sizeof SpawnOrg1);
			
			SetPlayerPos(playerid, SpawnOrg1[rnd][0], SpawnOrg1[rnd][1], SpawnOrg1[rnd][2]);
		}
		
		case 1:
		{
			new rnd = random(sizeof SpawnOrg2);
			
			SetPlayerPos(playerid, SpawnOrg2[rnd][0], SpawnOrg2[rnd][1], SpawnOrg2[rnd][2]);
		}
		
		case 2:
		{
			new rnd = random(sizeof SpawnOrg3);
			
			SetPlayerPos(playerid, SpawnOrg3[rnd][0], SpawnOrg3[rnd][1], SpawnOrg3[rnd][2]);
		}
		//Add mais se tiver
	}
	return true;
}



Re: Spawn Gangs - RazorSharpz - 27.01.2017

pawn Код:
new Float:SpawnOrg1[][] =
{
    {0.0, 0.0, 0.0},
    {0.0, 0.0, 0.0},
    {0.0, 0.0, 0.0},
    {0.0, 0.0, 0.0},
    {0.0, 0.0, 0.0}
    //Add mais se tiver
};

new Float:SpawnOrg2[][] =
{
    {0.0, 0.0, 0.0},
    {0.0, 0.0, 0.0},
    {0.0, 0.0, 0.0},
    {0.0, 0.0, 0.0},
    {0.0, 0.0, 0.0}
    //Add mais se tiver
};

new Float:SpawnOrg3[][] =
{
    {0.0, 0.0, 0.0},
    {0.0, 0.0, 0.0},
    {0.0, 0.0, 0.0},
    {0.0, 0.0, 0.0},
    {0.0, 0.0, 0.0}
    //Add mais se tiver
};

new PlayerOrg[MAX_PLAYERS]; // Variбvel da Org (adapte а sua)

public OnPlayerSpawn(playerid)
{
    switch(PlayerOrg[playerid])
    {
        case 0:
        {
            new rnd = random(sizeof SpawnOrg1);
           
            SetPlayerPos(playerid, SpawnOrg1[rnd][0], SpawnOrg1[rnd][1], SpawnOrg1[rnd][2]);
        }
       
        case 1:
        {
            new rnd = random(sizeof SpawnOrg2);
           
            SetPlayerPos(playerid, SpawnOrg2[rnd][0], SpawnOrg2[rnd][1], SpawnOrg2[rnd][2]);
        }
       
        case 2:
        {
            new rnd = random(sizeof SpawnOrg3);
           
            SetPlayerPos(playerid, SpawnOrg3[rnd][0], SpawnOrg3[rnd][1], SpawnOrg3[rnd][2]);
        }
        //Add mais se tiver
    }
    return true;
}
Obrigado XD