public OnPlayerSpawn(playerid)
{
new rand = random(sizeof(Arena1Spawns));
new rand2 = random(sizeof(Arena2Spawns));
if(passar == 0) SetPlayerPos(playerid, Arena1Spawns[rand][0], Arena1Spawns[rand][1],Arena1Spawns[rand][2]);
else if(passar == 1) SetPlayerPos(playerid, Arena2Spawns[rand2][0], Arena2Spawns[rand2][1],Arena2Spawns[rand2][2]);
return 1;
}
//-.--------------
forward MudarArena(playerid);
public MudarArena(playerid)
{
for(new i; i < MAX_PLAYERS; i++)
{
if(passar[playerid] == 0) // Linha 485
{
new rand = random(sizeof(Arena1Spawns));
SetPlayerPos(playerid, Arena1Spawns[rand][0], Arena1Spawns[rand][1],Arena1Spawns[rand][2]);
SetTimer("MudarCenario", 900000, 1); // Inicie novamente uma contagem ( Tem outros modos de fazer )
}
else if(passar[playerid] == 1) // Segundo Cenбrio
{
new rand = random(sizeof(Arena2Spawns));
SetPlayerPos(playerid, Arena2Spawns[rand][0], Arena2Spawns[rand][1],Arena2Spawns[rand][2]);
SetTimer("MudarCenario", 900000, 1); // Inicie novamente uma contagem ( Tem outros modos de fazer )
}
}
return 1;
}
error 033: array must be indexed (variable "passar") error 033: array must be indexed (variable "passar")
if(passar == 0) SetPlayerPos(playerid, Arena1Spawns[rand][0], Arena1Spawns[rand][1],Arena1Spawns[rand][2]);
else if(passar == 1) SetPlayerPos(playerid, Arena2Spawns[rand2][0], Arena2Spawns[rand2][1],Arena2Spawns[rand2][2]);
O erro й que diz que o passar ja ta definido :
Код:
error 033: array must be indexed (variable "passar") error 033: array must be indexed (variable "passar") pawn Код:
|
new passar2[MAX_PLAYERS];
if(passar2 == 0) SetPlayerPos(playerid, Arena1Spawns[rand][0], Arena1Spawns[rand][1],Arena1Spawns[rand][2]);
else if(passar2 == 1) SetPlayerPos(playerid, Arena2Spawns[rand2][0], Arena2Spawns[rand2][1],Arena2Spawns[rand2][2]);
new Arena1Spawns[MAX_PLAYERS];
if(Arena1Spawns[playerid] == 1)
{
SendClientMessage(playerid, -1, "Vocк esta na arena 1 jovem"); // Mensagem a ser enviada para quem estiver no cenбrio 1.
return 1;
}
if(passar[playerid] == 0) SetPlayerPos(playerid, Arena1Spawns[rand][0], Arena1Spawns[rand][1],Arena1Spawns[rand][2]);
else if(passar[playerid] == 1) SetPlayerPos(playerid, Arena2Spawns[rand2][0], Arena2Spawns[rand2][1],Arena2Spawns[rand2][2]);
new bool:arena1[MAX_PLAYERS];
public OnPlayerDeath(playerid, killerid, reason)
{
if(Arena1Spawns[playerid] == 1)
{
arena1[playerid] = 1;
}
}
public OnPlayerSpawn(playerid)
{
if(arena1[playerid] == 1) SetPlayerPos(playerid, CORDENADAS DA ARENA);
}
forward MudarArena(playerid);
public MudarArena(playerid)
{
for(new i; i < MAX_PLAYERS; i++)
{
if(passar[playerid] == 0) // Linha 485
{
new rand = random(sizeof(Arena1Spawns));
SetPlayerPos(playerid, Arena1Spawns[rand][0], Arena1Spawns[rand][1],Arena1Spawns[rand][2]);
SetTimer("MudarCenario", 900000, 1); // Inicie novamente uma contagem ( Tem outros modos de fazer )
}
else if(passar[playerid] == 1) // Segundo Cenбrio
{
new rand = random(sizeof(Arena2Spawns));
SetPlayerPos(playerid, Arena2Spawns[rand][0], Arena2Spawns[rand][1],Arena2Spawns[rand][2]);
SetTimer("MudarCenario", 900000, 1); // Inicie novamente uma contagem ( Tem outros modos de fazer )
}
}
return 1;
}