[AJUDA] /sair da casa nгo funciona!!
#1

Pessoal o /sair nao esta funcionando podem me ajudar?

Код:
	if(strcmp(cmd, "/entrar", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
		{
		    if(GetPlayerState(playerid) == 1) TeleportParaInteriores(playerid);
			for(new i = 0; i < sizeof(HouseInfo); i++)
			{
			    //new world = GetPlayerVirtualWorld(playerid)-1;
				if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
				{
					//printf("Found House :%d",i);
					if(PlayerInfo[playerid][pPhousekey] == i || HouseInfo[i][hLock] == 0)
					{
					    new OldWorld = GetPlayerVirtualWorld(playerid);
					    new NewWorld;
						SetPlayerInterior(playerid,HouseInfo[i][hInt]);
						SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
						GameTextForPlayer(playerid, "~w~Bem Vindo Em casa", 5000, 1);
						PlayerInfo[playerid][pInt] = HouseInfo[i][hInt];
						PlayerInfo[playerid][pLocal] = i;
						TaNaCasa[playerid] = i;
						SetPlayerVirtualWorld(playerid,HouseInfo[i][hWorld]);
						NewWorld = GetPlayerVirtualWorld(playerid);
						format(string, sizeof(string), "DEBUG: seu world foi mudado de: %d para: %d.", OldWorld,NewWorld);
					    SendClientMessage(playerid, COLOR_GREY, string);
					}
					else
					{
						GameTextForPlayer(playerid, "~r~Trancado", 5000, 1);
					}
				}
			}
Код:
	if(strcmp(cmd, "/sair", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
		{
			for(new i = 0; i <  sizeof(HouseInfo); i++)
			{
			  if(GetPlayerVirtualWorld(playerid) != 0 && TaNaHQ[playerid] == 255 && TaNaCasa[playerid] != 255)
			  {
                new world = GetPlayerVirtualWorld(playerid)-1;
				if (PlayerToPoint(3, playerid,HouseInfo[world][hExitx], HouseInfo[world][hExity], HouseInfo[world][hExitz]))
				{
					//new OldWorld = GetPlayerVirtualWorld(playerid);
					//new NewWorld;
					SetPlayerInterior(playerid,0);
					SetPlayerPos(playerid,HouseInfo[world][hEntrancex],HouseInfo[world][hEntrancey],HouseInfo[world][hEntrancez]);
					PlayerInfo[playerid][pInt] = 0;
					PlayerInfo[playerid][pLocal] = 255;
					SetPlayerVirtualWorld(playerid,0);
                    if(HouseInfo[i][hHel] == 1)
					{
						new Float:tempheal;
						GetPlayerHealth(playerid,tempheal);
						if(tempheal < 100.0)
						{
							SetPlayerHealth(playerid,100.0);
						}
					}
					/*NewWorld = GetPlayerVirtualWorld(playerid);
					format(string, sizeof(string), "DEBUG: seu world foi mudado de: %d para: %d.", OldWorld,NewWorld);
			  		SendClientMessage(playerid, COLOR_GREY, string);*/

				}
			  }
			}
Reply
#2

Ninguem vai ajudar?
Reply
#3

/destrancarcasa
Reply
#4

msm com a casa aberta nao da de sair
Reply
#5

Nгo da para sair porque vocк nгo passa o ID da casa para o servidor saber para onde mandar o player!
Onde estб HouseInfo[world]
Coloque HouseInfo[i]
Reply
#6

MSM assim nao funcionou

Код:
	if(strcmp(cmd, "/sair", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
		{
			for(new i = 0; i <  sizeof(HouseInfo); i++)
			{
			  if(GetPlayerVirtualWorld(playerid) != 0 && TaNaHQ[playerid] == 255 && TaNaCasa[playerid] != 255)
			  {
                //new world = GetPlayerVirtualWorld(playerid)-1;
				if (PlayerToPoint(3, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]))
				{
					new OldWorld = GetPlayerVirtualWorld(playerid);
					new NewWorld;
					SetPlayerInterior(playerid,0);
					SetPlayerPos(playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]);
					PlayerInfo[playerid][pInt] = 0;
					PlayerInfo[playerid][pLocal] = 255;
					SetPlayerVirtualWorld(playerid,0);
                    if(HouseInfo[i][hHel] == 1)
					{
						new Float:tempheal;
						GetPlayerHealth(playerid,tempheal);
						if(tempheal < 100.0)
						{
							SetPlayerHealth(playerid,100.0);
						}
					}
					NewWorld = GetPlayerVirtualWorld(playerid);
					format(string, sizeof(string), "DEBUG: seu world foi mudado de: %d para: %d.", OldWorld,NewWorld);
			  		SendClientMessage(playerid, COLOR_GREY, string);

				}
			  }
			}
Reply
#7

Alguem mas pode da sugestoes de que deve ser?
Reply
#8

Isto deve resolver o seu problema .


Basta trocar o seu /sair pelo que estб abaixo :


pawn Код:
if(strcmp(cmd, "/sair", true) == 0)
    {
        for(new loop = 0; loop < sizeof(HouseInfo); loop++)
        {
            if (PlayerToPoint(3, playerid,HouseInfo[loop][hExitx], HouseInfo[loop][hExity], HouseInfo[loop][hExitz]))
            {
                SetPlayerInterior(playerid,false);
                PlayerInfo[playerid][pInt] = 0;
                PlayerInfo[playerid][pLocal] = 255;
                SetPlayerPos(playerid,HouseInfo[loop][hEntrancex],HouseInfo[loop][hEntrancey],HouseInfo[loop][hEntrancez]);
                SetPlayerVirtualWorld(playerid,false);
                if(HouseInfo[i][hHel] == 1)
                {
                    new Float:tempheal;
                    GetPlayerHealth(playerid,tempheal);
                    if(tempheal < 100.0)
                    {
                        SetPlayerHealth(playerid,100.0);
                    }
                }
            }
        }
        return true
    }

Espero ter ajudado .
Reply
#9

RJJJ nгo funciono mano, mas alguem pode ajudar?
Reply
#10

Mas alguem pode ajudar?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)