House system not working proply.
#3

pawn Код:
CMD:buyhouse(playerid, params[])
{
    if(PlayerInfo[playerid][HouseKey] == 9999)
    {
        for(new h = 1; h < sizeof(HouseInfo); h++)
        {
            if(IsPlayerInRangeOfPoint(playerid, 1.0, HouseInfo[h][X], HouseInfo[h][Y], HouseInfo[h][Z]))
            {
                new string[128], Name[MAX_PLAYER_NAME];
                GetPlayerName(playerid, Name, sizeof(Name));
                PlayerInfo[playerid][HouseKey] = h;
                HouseInfo[h][Owner] = GetPlayerName(playerid, Name, sizeof(Name));
                HouseInfo[h][Ownable] = 0;
                DestroyPickup(housepickup[h]);
                Delete3DTextLabel(housetext[h]);
                housepickup[h] = CreatePickup(1272, 1, HouseInfo[h][X], HouseInfo[h][Y], HouseInfo[h][Z], 0);
                format(string, sizeof(string), "This house is owned. Owner: %s", Name);
                housetext[h] = Create3DTextLabel(string, COLOR_RED, HouseInfo[h][X], HouseInfo[h][Y], HouseInfo[h][Z], 10.0, 0);
                format(file, sizeof(file), "RRP/houses/%d.ini", h);
                if(fexist(file))
                {
                    dini_Set(file, "Owner", Name);
                    dini_IntSet(file, "Ownable", 0);
                }
                format(file, sizeof(file), "RRP/users/%s.ini", Name);
                if(fexist(file))
                {
                    dini_IntSet(file, "HouseKey", h);
                }
                return 1;
            }
        }
        return SendClientMessage(playerid, 0xFFFFFFFF, "You are not near any house.");
    }
    else return SendClientMessage(playerid, 0xFFFFFFFF, "You already own a house.");
}
Reply


Messages In This Thread
House system not working proply. - by ricardo178 - 24.05.2012, 19:08
Re: House system not working proply. - by IceCube! - 24.05.2012, 19:10
Re: House system not working proply. - by ViniBorn - 24.05.2012, 19:11
Re: House system not working proply. - by IceCube! - 24.05.2012, 19:14
Re: House system not working proply. - by ViniBorn - 24.05.2012, 19:15
Re: House system not working proply. - by IceCube! - 24.05.2012, 19:16
Re: House system not working proply. - by ViniBorn - 24.05.2012, 19:21
Re: House system not working proply. - by ricardo178 - 24.05.2012, 19:58
Re: House system not working proply. - by ViniBorn - 24.05.2012, 20:13
Re: House system not working proply. - by ricardo178 - 24.05.2012, 20:14

Forum Jump:


Users browsing this thread: 1 Guest(s)