[Ajuda] evento -
Cristhian - 29.10.2011
como faзo para o cara quando digitar por exemplo /irevento aparecer em deferentes locais e caso um player jб tiver no 1є local o player ir para outro local e caso tiver tudo cheio nгo ir para local nenhum..
Re: [duvida] evento -
Don_Speed - 29.10.2011
posta o cmdachu q fica mais facil
Re: [duvida] evento -
iansinho - 29.10.2011
faz algo tipo: cria uma vбriavel
No comando vocк checa:
pawn Код:
if(Estanoevento == 0)
{
Setplayerpos...
Estanoevento = 1;
}
else if(Estanoevento == 1)
{
SetPlayerPos...
Estanoevento = 2;
}
Algo parecido, fiz assim sу de exemplo pra vocк, to meio ocupado.
Re: [duvida] evento -
[O.z]Caroline - 29.10.2011
Verifica se tem algum player nesta posiзгo:
pawn Код:
stock IsPlayerInPos(Float: Pos_X, Float: Pos_Y, Float: Pos_Z);
{
for(new i; i < MAX_PLAYERS; ++i)
{
if(IsPlayerConnected(i) && IsPlayerInRangeOfPoint(i, 2.0, Pos_X, Pos_Y, Pos_Z)
{
return true;
}
}
return false;
}
Modo de uso:
pawn Код:
if(!IsPlayerInPos(CordenadaX, CordenadaY, CoordenadaZ)) // se nгo existir...
{
SetPlayerPos(playerid, CordenadaX, CordenadaY, CoordenadaZ);
}
Re: [duvida] evento -
Cristhian - 29.10.2011
pawn Код:
if(strcmp(cmdtext, "/irevento", true) == 0)
{
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(!evento[i]) return SendClientMessage(playerid, -1, "Evento nгo estб aberto");
if(!damas[0][i])
{
SetPlayerPos(playerid, 2139.7417,-4206.8960,9.7203);
damas[0][i] = true;
return 1;
}
else if(!damas[1][i])
{
SetPlayerPos(playerid, 2143.1997,-4295.2114,9.6977);
damas[1][i] = true;
return 1;
}
else if(!damas[2][i])
{
SetPlayerPos(playerid, 2177.1826,-4295.4995,9.6861);
damas[2][i] = true;
return 1;
}
else if(!damas[3][i])
{
SetPlayerPos(playerid, 2216.0708,-4294.6152,9.6988);
damas[3][i] = true;
return 1;
}
else if(!damas[4][i])
{
SetPlayerPos(playerid, 2250.5933,-4292.4912,9.6984);
damas[4][i] = true;
return 1;
}
else if(!damas[5][i])
{
SetPlayerPos(playerid, 2288.4783,-4291.3901,9.6453);
damas[5][i] = true;
return 1;
}
else if(!damas[6][i])
{
SetPlayerPos(playerid, 2325.3833,-4289.4883,9.3727);
damas[6][i] = true;
return 1;
}
else if(!damas[7][i])
{
SetPlayerPos(playerid, 2321.9485,-4203.3970,9.6152);
damas[7][i] = true;
return 1;
}
else if(!damas[8][i])
{
SetPlayerPos(playerid, 2291.1157,-4203.1714,9.6847);
damas[8][i] = true;
}
else if(!damas[9][i])
{
SetPlayerPos(playerid, 2252.5278,-4205.3608,9.7127);
damas[9][i] = true;
return 1;
}
else if(!damas[10][i])
{
SetPlayerPos(playerid, 2216.4785,-4203.9727,9.7653);
damas[10][i] = true;
return 1;
}
else if(!damas[11][i])
{
SetPlayerPos(playerid, 2178.0195,-4206.8096,9.8171);
damas[11][i] = true;
return 1;
}
else if(damas[11][i]) return SendClientMessage(playerid, -1, "Evento Lotado");
}
return 1;
}
CORRECT?
Re: [duvida] evento -
iansinho - 29.10.2011
Quote:
Originally Posted by Cristhian
pawn Код:
if(strcmp(cmdtext, "/irevento", true) == 0) { for(new i = 0; i <= MAX_PLAYERS; i++) { if(!evento[i]) return SendClientMessage(playerid, -1, "Evento nгo estб aberto"); if(!damas[0][i]) { SetPlayerPos(playerid, 2139.7417,-4206.8960,9.7203); damas[0][i] = true; return 1; } else if(!damas[1][i]) { SetPlayerPos(playerid, 2143.1997,-4295.2114,9.6977); damas[1][i] = true; return 1; } else if(!damas[2][i]) { SetPlayerPos(playerid, 2177.1826,-4295.4995,9.6861); damas[2][i] = true; return 1; } else if(!damas[3][i]) { SetPlayerPos(playerid, 2216.0708,-4294.6152,9.6988); damas[3][i] = true; return 1; } else if(!damas[4][i]) { SetPlayerPos(playerid, 2250.5933,-4292.4912,9.6984); damas[4][i] = true; return 1; } else if(!damas[5][i]) { SetPlayerPos(playerid, 2288.4783,-4291.3901,9.6453); damas[5][i] = true; return 1; } else if(!damas[6][i]) { SetPlayerPos(playerid, 2325.3833,-4289.4883,9.3727); damas[6][i] = true; return 1; } else if(!damas[7][i]) { SetPlayerPos(playerid, 2321.9485,-4203.3970,9.6152); damas[7][i] = true; return 1; } else if(!damas[8][i]) { SetPlayerPos(playerid, 2291.1157,-4203.1714,9.6847); damas[8][i] = true; } else if(!damas[9][i]) { SetPlayerPos(playerid, 2252.5278,-4205.3608,9.7127); damas[9][i] = true; return 1; } else if(!damas[10][i]) { SetPlayerPos(playerid, 2216.4785,-4203.9727,9.7653); damas[10][i] = true; return 1; } else if(!damas[11][i]) { SetPlayerPos(playerid, 2178.0195,-4206.8096,9.8171); damas[11][i] = true; return 1; } else if(damas[11][i]) return SendClientMessage(playerid, -1, "Evento Lotado"); } return 1; }
CORRECT?
|
Testa lб, 99% de certeza.
Re: [duvida] evento -
CristoferBahr - 29.10.2011
Quote:
Originally Posted by Cristhian
pawn Код:
if(strcmp(cmdtext, "/irevento", true) == 0) { for(new i = 0; i <= MAX_PLAYERS; i++) { if(!evento[i]) return SendClientMessage(playerid, -1, "Evento nгo estб aberto"); if(!damas[0][i]) { SetPlayerPos(playerid, 2139.7417,-4206.8960,9.7203); damas[0][i] = true; return 1; } else if(!damas[1][i]) { SetPlayerPos(playerid, 2143.1997,-4295.2114,9.6977); damas[1][i] = true; return 1; } else if(!damas[2][i]) { SetPlayerPos(playerid, 2177.1826,-4295.4995,9.6861); damas[2][i] = true; return 1; } else if(!damas[3][i]) { SetPlayerPos(playerid, 2216.0708,-4294.6152,9.6988); damas[3][i] = true; return 1; } else if(!damas[4][i]) { SetPlayerPos(playerid, 2250.5933,-4292.4912,9.6984); damas[4][i] = true; return 1; } else if(!damas[5][i]) { SetPlayerPos(playerid, 2288.4783,-4291.3901,9.6453); damas[5][i] = true; return 1; } else if(!damas[6][i]) { SetPlayerPos(playerid, 2325.3833,-4289.4883,9.3727); damas[6][i] = true; return 1; } else if(!damas[7][i]) { SetPlayerPos(playerid, 2321.9485,-4203.3970,9.6152); damas[7][i] = true; return 1; } else if(!damas[8][i]) { SetPlayerPos(playerid, 2291.1157,-4203.1714,9.6847); damas[8][i] = true; } else if(!damas[9][i]) { SetPlayerPos(playerid, 2252.5278,-4205.3608,9.7127); damas[9][i] = true; return 1; } else if(!damas[10][i]) { SetPlayerPos(playerid, 2216.4785,-4203.9727,9.7653); damas[10][i] = true; return 1; } else if(!damas[11][i]) { SetPlayerPos(playerid, 2178.0195,-4206.8096,9.8171); damas[11][i] = true; return 1; } else if(damas[11][i]) return SendClientMessage(playerid, -1, "Evento Lotado"); } return 1; }
CORRECT?
|
pawn Код:
else if(!damas[8][i])
{
SetPlayerPos(playerid, 2291.1157,-4203.1714,9.6847);
damas[8][i] = true;
}
Faltou um Return
pawn Код:
else if(!damas[8][i])
{
SetPlayerPos(playerid, 2291.1157,-4203.1714,9.6847);
damas[8][i] = true;
return 1;
}
Re: [duvida] evento -
Cristhian - 29.10.2011
valeu nem tinha visto ...
aproveitando o tуpico alguйm sabe o que pode causar quando digita um comando enviar 1milhгo de mensagens ao invйs de 1 sу..
Re: [duvida] evento -
CristoferBahr - 29.10.2011
Poste o comando ;p
Re: [duvida] evento -
Cristhian - 29.10.2011
pawn Код:
if(strcmp(cmdtext, "/abrirevento", true) == 0)
{
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(evento[i]) return SendClientMessage(playerid, -1, "Algum evento jб estб em andamento");
evento[i] = true;
damas[0][i] = false; damas[1][i] = false; damas[2][i] = false;
damas[3][i] = false; damas[4][i] = false; damas[5][i] = false;
damas[6][i] = false; damas[7][i] = false; damas[8][i] = false;
damas[9][i] = false; damas[10][i] = false; damas[11][i] = false;
format(msg, sizeof(msg), "O Admin %s abriu o evento Damas, /irevento para participar", pname);
SendClientMessageToAll(-1, msg);
}
return 1;
}