19.01.2011, 13:33
pawn Код:
if(strcmp(cmd, "/exit", true) == 0)
{
if(IsPlayerConnected(playerid))
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,HouseInfo[HouseEntered[playerid]][hEntrancex],HouseInfo[HouseEntered[playerid]][hEntrancey],HouseInfo[HouseEntered[playerid]][hEntrancez]);
PlayerInfo[playerid][pInt] = 0;
PlayerInfo[playerid][pLocal] = 255;
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid,0);
HouseEntered[playerid] = 255;
if(HouseInfo[HouseEntered[playerid]][hHel] == 1)
{
new Float:tempheal;
GetPlayerHealth(playerid,tempheal);
if(tempheal < 100.0)
{
SetPlayerHealth(playerid,100.0);
}
}
return 1;
}
Now you should add the check your self, to check if a player is in a house
pawn Код:
if(HouseEntered[playerid] == 0)
{
SendClientMessage(playerid, COLOR_YELLOW, "You're not in a house");
return 1;
}
EDIT: edited some code