Problem With Exit house to interior
#1

i maded script that in somehouses when somebody write /exit he will spawn in other interior but i have a little bug
that only if im near the door its works but when i move away from the door and type /exit its exit to interior 0
Here is my script


Код:
	if(strcmp(cmd, "/exit", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
		{
      new h = PlayerInfo[playerid][pLocal];
      new house = GetHouseID(playerid);
			if (PlayerToPoint(3, playerid,HouseInfo[h][hExitx], HouseInfo[h][hExity], HouseInfo[h][hExitz]))
			{
			if (!IsAnMultiRooms(house))
			{
				SetPlayerInterior(playerid,0);
				SetPlayerVirtualWorld(playerid,0);//here it set your world back to 0
				SetPlayerPos(playerid,HouseInfo[h][hEntrancex],HouseInfo[h][hEntrancey],HouseInfo[h][hEntrancez]);
				PlayerInfo[playerid][pInt] = 0;
				PlayerInfo[playerid][pLocal] = 255;
				if(HouseInfo[h][hHel] == 1)
				{
					new Float:tempheal;
					GetPlayerHealth(playerid,tempheal);
					if(tempheal < 100.0)
					{
						SetPlayerHealth(playerid,100.0);
					}
			  }
			}
			else{
			SetPlayerInterior(playerid,15);
			SetPlayerVirtualWorld(playerid,0);
			SetPlayerPos(playerid,HouseInfo[h][hEntrancex],HouseInfo[h][hEntrancey],HouseInfo[h][hEntrancez]);
			PlayerInfo[playerid][pInt] = 15;
			}
			return 1;
			}
Thanks

Reply
#2

Mind fixing the interior? Can't be bothered looking it like this.
Reply
#3

So What should i do? i wanna know what is wrong in my script?
Reply
#4

Oh, I meant to fix the identitation, my bad.


Fix it so I can read it and help you.
Reply
#5

You mean indentation? if yes i fixed.
Reply
#6

No one?
Reply
#7

Thanks for the help
Reply
#8

Indentation is still kind of fucked on this, can you fix it so we can help you?
Reply
#9

How? try this

if(strcmp(cmd, "/exit", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new h = PlayerInfo[playerid][pLocal];
new house = GetHouseID(playerid);
if (PlayerToPoint(3, playerid,HouseInfo[h][hExitx], HouseInfo[h][hExity], HouseInfo[h][hExitz]))
{
if (!IsAnMultiRooms(house))
{
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid,0);//here it set your world back to 0
SetPlayerPos(playerid,HouseInfo[h][hEntrancex],HouseInfo[h][hEntrancey],HouseInfo[h][hEntrancez]);
PlayerInfo[playerid][pInt] = 0;
PlayerInfo[playerid][pLocal] = 255;
if(HouseInfo[h][hHel] == 1)
{
new Float:tempheal;
GetPlayerHealth(playerid,tempheal);
if(tempheal < 100.0)
{
SetPlayerHealth(playerid,100.0);
}
}
}
else{
SetPlayerInterior(playerid,15);
SetPlayerVirtualWorld(playerid,0);
SetPlayerPos(playerid,HouseInfo[h][hEntrancex],HouseInfo[h][hEntrancey],HouseInfo[h][hEntrancez]);
PlayerInfo[playerid][pInt] = 15;
}
return 1;
}
Reply
#10

This is still Indentation?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)