Problem With Exit house to interior -
Ben147 - 05.08.2009
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
Re: Problem With Exit house to interior -
MenaceX^ - 05.08.2009
Mind fixing the interior? Can't be bothered looking it like this.
Re: Problem With Exit house to interior -
Ben147 - 05.08.2009
So What should i do? i wanna know what is wrong in my script?
Re: Problem With Exit house to interior -
MenaceX^ - 05.08.2009
Oh, I meant to fix the identitation, my bad.
Fix it so I can read it and help you.
Re: Problem With Exit house to interior -
Ben147 - 05.08.2009
You mean indentation? if yes i fixed.
Re: Problem With Exit house to interior -
Ben147 - 05.08.2009
No one?
Re: Problem With Exit house to interior -
Ben147 - 06.08.2009
Thanks for the help
Re: Problem With Exit house to interior -
RayPoda - 06.08.2009
Indentation is still kind of fucked on this, can you fix it so we can help you?
Re: Problem With Exit house to interior -
Ben147 - 06.08.2009
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;
}
Re: Problem With Exit house to interior -
Ben147 - 06.08.2009
This is still Indentation?