forward MudarArena(playerid);
public MudarArena(playerid)
{
for(new i; i < MAX_PLAYERS; i++)
{
new passar;
if(passar[playerid] == 0) // Primeira Arena
{
rand = random(sizeof(SpawnA1));
SetPlayerPos(playerid, SpawnA1[rand][0], SpawnA1[rand][1], SpawnA1[rand][2]);
GetPlayerFacingAngle(playerid, SpawnA1[rand][3]);
QualArena = 1;
SetTimer("MudarArena", 900000, 1);
}
else if(passar[playerid] == 1) // Segunda Arena
{
rand = random(sizeof(SpawnA2));
SetPlayerPos(playerid, SpawnA2[rand][0], SpawnA2[rand][1], SpawnA2[rand][2]);
GetPlayerFacingAngle(playerid, SpawnA2[rand][3]);
QualArena = 2;
SetTimer("MudarArena", 900000, 1);
}
}
return 1;
}
// la no topo
new QualArena[MAX_PLAYERS] = 0;
forward MudarArena(playerid);
public MudarArena(playerid)
{
for(new i; i < MAX_PLAYERS; i++)
{
if(QualArena[playerid] == 0) // Primeira Arena
{
rand = random(sizeof(SpawnA1));
SetPlayerPos(playerid, SpawnA1[rand][0], SpawnA1[rand][1], SpawnA1[rand][2]);
GetPlayerFacingAngle(playerid, SpawnA1[rand][3]);
QualArena[playerid] = 1;
SetTimer("MudarArena", 900000, 1);
}
if(QualArena[playerid] == 1) // Segunda Arena
{
rand = random(sizeof(SpawnA2));
SetPlayerPos(playerid, SpawnA2[rand][0], SpawnA2[rand][1], SpawnA2[rand][2]);
GetPlayerFacingAngle(playerid, SpawnA2[rand][3]);
QualArena[playerid] = 0;
SetTimer("MudarArena", 900000, 1);
}
}
return 1;
}
Isso assim nгo vai calhar a mesma arena correcto? Й possнvel por as arenas aleatуrias ?
|
forward MudarArena(playerid);
public MudarArena(playerid)
{
for(new i; i < MAX_PLAYERS; i++)
{
new pt = random(2); // 2 numero de arenas
switch(pt)
{
case 0:
{
rand = random(sizeof(SpawnA1));
SetPlayerPos(playerid, SpawnA1[rand][0], SpawnA1[rand][1], SpawnA1[rand][2]);
GetPlayerFacingAngle(playerid, SpawnA1[rand][3]);
SetTimer("MudarArena", 900000, 1);
}
default:
{
rand = random(sizeof(SpawnA2));
SetPlayerPos(playerid, SpawnA2[rand][0], SpawnA2[rand][1], SpawnA2[rand][2]);
GetPlayerFacingAngle(playerid, SpawnA2[rand][3]);
SetTimer("MudarArena", 900000, 1);
}
}
}
return 1;
}
default ponho case 1: depois noutra arena que eu adicione, case 2: etc certo ?
|
forward MudarArena(playerid);
public MudarArena(playerid)
{
for(new i; i < MAX_PLAYERS; i++)
{
new pt = random(2); // 2 numero de arenas
switch(pt)
{
case 0:
{
rand = random(sizeof(SpawnA1));
SetPlayerPos(playerid, SpawnA1[rand][0], SpawnA1[rand][1], SpawnA1[rand][2]);
GetPlayerFacingAngle(playerid, SpawnA1[rand][3]);
SetTimer("MudarArena", 900000, 1);
}
case 1:
case 2:
....
default:
{
rand = random(sizeof(SpawnA2));
SetPlayerPos(playerid, SpawnA2[rand][0], SpawnA2[rand][1], SpawnA2[rand][2]);
GetPlayerFacingAngle(playerid, SpawnA2[rand][3]);
SetTimer("MudarArena", 900000, 1);
}
}
}
return 1;
}