[GZ] - Erro ao Dominar -
Peedro Felix - 19.02.2011
Diz Que Nгo Tou em nenhum Territorio Qual й o erro ? Tipo a GZ Aparece blz. Ai quando chego Nela Digito /do Diz Que Nгo Estou Em Nenhum Territorio ajuda :d
pawn Код:
if(strcmp(cmd, "/dominar", true) == 0 || strcmp(cmd, "/do", true) == 0)
{
if(PlayerInfo[playerid][pMembro] == 22 || PlayerInfo[playerid][pLider] == 22)//Mafia LH
{
if(IsPlayerInEstacao(playerid))
{
if(Dominando[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GRAD5, "Vocк ja estб dominando um territorio.");
return 1;
}
if(GuerranaEstacao == 1)
{
SendClientMessage(playerid, COLOR_GRAD5, "Jб estб tendo uma guerra nesse territorio.");
return 1;
}
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s e a Mafia La Hermandad estгo dominando a Estaзгo!",playername);
SendClientMessageToAll(COLOR_LH, string);
SendClientMessage(playerid, COLOR_GRAD3, "Fique esperto, todas as mafias e a Policia Federal foram avisados!");
SendClientMessage(playerid, COLOR_GRAD5, "Espere 1 minuto para dominar estб area .");
GangZoneFlashForAll(GZEstacao,COLORGZ_LH);
Dominando[playerid] = 1;
ProvocoEstacao[playerid] = 1;
GuerranaEstacao = 1;
TempoGuerraEstacao = SetTimerEx("GuerraEstacao", 60000, 0, "i", playerid);
return 1;
}
else if(IsPlayerInCasarao(playerid))
{
if(Dominando[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GRAD5, "Vocк ja estб dominando um territorio.");
return 1;
}
if(GuerranoCasarao == 1)
{
SendClientMessage(playerid, COLOR_GRAD5, "Jб estб tendo uma guerra nesse territorio.");
return 1;
}
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s e a Mafia La Hermandad estгo dominando o Casarгo!",playername);
SendClientMessageToAll(COLOR_LH, string);
SendClientMessage(playerid, COLOR_GRAD3, "Fique esperto, todas as mafias e a Policia Federal foram avisados!");
SendClientMessage(playerid, COLOR_GRAD5, "Espere 1 minuto para dominar estб area .");
GangZoneFlashForAll(GZCasarao,COLORGZ_LH);
Dominando[playerid] = 1;
ProvocoCasarao[playerid] = 1;
GuerranoCasarao = 1;
TempoGuerraCasarao = SetTimerEx("GuerraCasarao", 60000, 0, "i", playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD3, "Vocк nгo estб em nenhum territуrio!"); // Aqui e o erro
}
return 1;
}
// Aqui a Stock
stock IsPlayerInEstacao(playerid)
{
new Float:x,Float:y,Float:z; // -2873.9722,1236.1442
GetPlayerPos(playerid, x, y, z);
if(x >= -2747.9409 && y >= 998.4983 && x <= -2873.9722 && y <= 1236.1442) return 1;
else return 0;
}
stock IsPlayerInCasarao(playerid)
{
new Float:x,Float:y,Float:z; // -2141.2271,315.2415
GetPlayerPos(playerid, x, y, z); // -2011.4912,113.5114
if(x >= -2011.4912 && y >= 113.5114 && x <= -2141.2271 && y <= 315.2415) return 1;
else return 0;
}
Re: [GZ] - Erro ao Dominar -
ViniBorn - 19.02.2011
Tenta assim
pawn Код:
stock IsPlayerInEstacao(playerid)
{
new Float:x,Float:y,Float:z; // -2873.9722,1236.1442
GetPlayerPos(playerid, x, y, z);
if(x >= -2873.9722 && y >= 998.4983 && x <= -2747.9409 && y <= 1236.1442) return 1;
else return 0;
}
stock IsPlayerInCasarao(playerid)
{
new Float:x,Float:y,Float:z; // -2141.2271,315.2415
GetPlayerPos(playerid, x, y, z); // -2011.4912,113.5114
if(x >= -2141.2271 && y >= 113.5114 && x <= -2011.4912 && y <= 315.2415) return 1;
else return 0;
}
Re: [GZ] - Erro ao Dominar -
Peedro Felix - 19.02.2011
Nem й a Estaзao a GZ й em SF, So ta com nome de estacao
Re: [GZ] - Erro ao Dominar -
ViniBorn - 19.02.2011
Vocк se confundiu com a coordenada X.
Onde era pra colocar o menor valor de X, vocк colocou o maior, e vice-versa.
-2141.2271 й o menor
-2011.4912 й o maior
Re: [GZ] - Erro ao Dominar -
Peedro Felix - 19.02.2011
pawn Код:
GZEstacao = GangZoneCreate(-2747.9409,998.4983, -2873.9722,1236.1442);
GZCasarao = GangZoneCreate(-2011.4912,113.5114, -2141.2271,315.2415);
Re: [GZ] - Erro ao Dominar -
ViniBorn - 19.02.2011
O erro nгo estб na criaзгo da GZ, estб no cуdigo que verifica se o player estб na Estaзгo / Casarгo.
Substitua o cуdigo atual pelo que eu postei ali emcima, e diga se funcionou.
Re: [GZ] - Erro ao Dominar -
Peedro Felix - 19.02.2011
Vlw Vini
Re: [GZ] - Erro ao Dominar -
ViniBorn - 19.02.2011
De nada ; )
Re: [GZ] - Erro ao Dominar -
Peedro Felix - 19.02.2011
й nois
Re: [GZ] - Erro ao Dominar -
ViniBorn - 19.02.2011
Vocк substituiu os dois que coloquei? Ou sу o do Casarгo?