SA-MP Forums Archive
[Ajuda] Bug /Dominar - 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: [Ajuda] Bug /Dominar (/showthread.php?tid=566828)



Bug /Dominar - GMM08 - 08.03.2015

Estou com um bug em um territуrio, quando eu digito /do aparece: Vocк nгo estб em nenhum territуrio... Alguйm sabe me ajudar ?

Код:
else if(OrgID == 3 || OrgID == 27)
		{
            if(IsPlayerInHidre(playerid))
			{
			    if(Dominando[playerid] == 1)
    			{
	   				SendClientMessage(playerid, COLOR_GRAD5, "Vocк ja estб dominando um territorio.");
	    			return 1;
    			}
    			if(GuerranaHidre == 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 %s estгo dominando a Hidre!",playername,NomeORGTr(OrgID));
		        SendClientMessageToAll(OrgCor(OrgID), string);
	                SendClientMessage(playerid, COLOR_GRAD3, "Fique esperto os Inimigos foram avisados!");
	                SendClientMessage(playerid, COLOR_GRAD5, "Espere 30 segundos para dominar estб area .");
                        GangZoneFlashForAll(GZHidre,OrgCor(OrgID));
                        Dominando[playerid] = 1;
                        ProvocoHidre[playerid] = 1;
                        GuerranaHidre = 1;
   				TempoGuerraHidre = SetTimerEx("GuerraHidre", 30000, 0, "i", playerid);
				return 1;
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD3, "Vocк nгo estб em nenhum territуrio!");
			}
		}


stock IsPlayerInHidre(playerid)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid, x, y, z);
    if(x >= -591.7480 && y >= 1805.1368 && x <= -817.9867 && y <= 2048.1484) return 1;
    else return 0;
}
Se precisar de mais cуdigos й sу me avisar...


Re: Bug /Dominar - smiiir - 08.03.2015

Vocк precisa colocar as coordenadas da бrea para dominar aqui:

pawn Код:
stock IsPlayerInHidre(playerid) {
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid, x, y, z);
    if(x >= -591.7480 && y >= 1805.1368 && x <= -817.9867 && y <= 2048.1484) return 1;
    else return 0;
}
Recomendo utilizar IsPlayerInRangeOfPoint, vocк pode estudar aqui: https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint


Re: Bug /Dominar - GMM08 - 11.03.2015

Alguem ajuda ? A resposta do smiiir nгo resolveu , mesmo assim obrigado!