BIG House Problem - Fast !
#2

pawn Код:
new HOUSE_ID_FOUND[499+1]; // at the top of the script
pawn Код:
if(strcmp(cmd, "/enter", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            for(new i = 0; i < sizeof(HouseInfo); i++)
            {
                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)
                    {
                        SetPlayerInterior(playerid,HouseInfo[i][hInt]);
                        SetPlayerVirtualWorld(playerid, (i + 1));
                        SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
                        GameTextForPlayer(playerid, "~g~Welcome Home", 5000, 1);
                        PlayerInfo[playerid][pInt] = HouseInfo[i][hInt];
                        PlayerInfo[playerid][pLocal] = i;
                                                HOUSE_ID_FOUND[playerid] = i;
                    }
                    else
                    {
                        GameTextForPlayer(playerid, "~r~Closed", 5000, 1);
                    }
                }
            }

pawn Код:
if(strcmp(cmd, "/exit", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
       
                //printf("House :%d",i);
                if (PlayerToPoint(1, playerid,HouseInfo[HOUSE_ID_FOUND[playerid]][hExitx], HouseInfo[HOUSE_ID_FOUND[playerid]][hExity], HouseInfo[HOUSE_ID_FOUND[playerid]][hExitz]))
                {
                    SetPlayerInterior(playerid,0);
                    SetPlayerVirtualWorld(playerid, 0);
                    SetPlayerPos(playerid,HouseInfo[HOUSE_ID_FOUND[playerid]][hEntrancex],HouseInfo[HOUSE_ID_FOUND[playerid]][hEntrancey],HouseInfo[HOUSE_ID_FOUND[playerid]][hEntrancez]);
                    PlayerInfo[playerid][pInt] = 0;
                    PlayerInfo[playerid][pLocal] = 255;
                    if(HouseInfo[HOUSE_ID_FOUND[playerid]][hHel] == 1)
                    {
                        new Float:tempheal;
                        GetPlayerHealth(playerid,tempheal);
                        if(tempheal < 100.0)
                        {
                            SetPlayerHealth(playerid,100.0);
                        }
                    }
            }
Reply


Messages In This Thread
BIG House Problem - Fast ! - by MrBlake - 29.07.2011, 08:42
Re: BIG House Problem - Fast ! - by TouR - 29.07.2011, 09:01
Re: BIG House Problem - Fast ! - by MrBlake - 29.07.2011, 09:33
Re: BIG House Problem - Fast ! - by MrBlake - 29.07.2011, 11:14
Re: BIG House Problem - Fast ! - by TouR - 29.07.2011, 11:16
Re: BIG House Problem - Fast ! - by MrBlake - 29.07.2011, 11:26
Re: BIG House Problem - Fast ! - by TouR - 29.07.2011, 13:20
Re: BIG House Problem - Fast ! - by MrBlake - 29.07.2011, 19:04

Forum Jump:


Users browsing this thread: 2 Guest(s)