Help House
#10

i can buy more 2
PHP код:
CMD:buyhouse(playeridparams[])
{
    new 
name[MAX_PLAYER_NAME], labelstring[144], string[144], file[50];
    
GetPlayerName(playeridnamesizeof(name));
    for(new 
0MAX_HOUSESi++)
    {
        if(
IsPlayerInRangeOfPoint(playerid5.0HouseInfo[i][hX], HouseInfo[i][hY], HouseInfo[i][hZ]))
        {
            if(
HouseInfo[i][hOwned] == 1) return SendClientMessage(playerid, -1"{FF0000}ERROR: {FFFFFF}This house have an Owner.");
            if(
GetPlayerMoney(playerid) < HouseInfo[i][hPrice]) return SendClientMessage(playerid, -1"{FF0000}ERROR: {FFFFFF}You don't have enough money.");
            
maxHouses[playerid]++;
            if(
maxHouses[playerid] == 2) return SendClientMessage(playerid,-1,"You can only own  2 houses");
            
DestroyPickup(HouseInfo[i][hPick]);
            
format(labelstringsizeof(labelstring), "{15FF00}House ID: {FFFFFF}%d\n{15FF00}Owner: {FFFFFF}%s\n{15FF00}Price: {FFFFFF}%d"inameHouseInfo[i][hPrice]);
            
HouseInfo[i][hPick] = CreatePickup(12721HouseInfo[i][hX], HouseInfo[i][hY], HouseInfo[i][hZ]);
            
Update3DTextLabelText(HouseInfo[i][hLabel], 0xFFFFFFFFlabelstring);
            
format(stringsizeof(string), "{FF0000}[HOUSE]: {FFFFFF}You bought house ID: {FF0000}%d {FFFFFF}for {FF0000}$ %d."iHouseInfo[i][hPrice]);
            
SendClientMessage(playerid, -1string);
            
HouseInfo[i][hOwned] = 1;
            
HouseInfo[i][hOwner] = name;
            
format(filesizeof(file), "Houses/%d.ini"i);
            if(
fexist(file))
            {
                
dini_IntSet(file"Owned"1);
                
dini_Set(file"Owner"name);
            }
        }
    }
    return 
1;

i still can buying what ever like 1000
Reply


Messages In This Thread
Help House - by ommar8080 - 17.03.2017, 19:07
Re: Help House - by lackmail - 17.03.2017, 19:10
Re: Help House - by Toroi - 17.03.2017, 19:11
Re: Help House - by ommar8080 - 17.03.2017, 19:12
Re: Help House - by Bolex_ - 17.03.2017, 19:41
Re: Help House - by ommar8080 - 17.03.2017, 20:10
Re: Help House - by Bolex_ - 17.03.2017, 20:15
Re: Help House - by ommar8080 - 17.03.2017, 21:21
Re: Help House - by LazzyBoy - 17.03.2017, 21:27
Re: Help House - by ommar8080 - 17.03.2017, 21:40

Forum Jump:


Users browsing this thread: 2 Guest(s)