House - Buy
#1

pawn Код:
if(strcmp(string,"buy",true) == 0) // House kaufen
    {
        if(house > 0) return ShowInfoDialog(playerid, "House - Info", "You already own a house");
        for(new h = 0; h <= gHouse; h++)
        {
            if(IsPlayerInRangeOfPoint(playerid, 2.0, hInfo[h][hEntrancex], hInfo[h][hEntrancey], hInfo[h][hEntrancez]))
            {
                if(!strcmp(hInfo[h][hOwner], "None", true))
                {
                    if(GetUserMoney(playerid) >= hInfo[h][hValue])
                    {
                        new
                            sendername[MAX_PLAYER_NAME];
                        print("Blad - Proccesed");
                        GetPlayerName(playerid, sendername, MAX_PLAYER_NAME);
                        print("Blad - Proccesed");
                        strmid(hInfo[h][hOwner], sendername, 0, strlen(sendername), 255);
                        print("Blad - Proccesed");
                        GiveUserMoney(playerid,-hInfo[h][hValue]);
                        print("Blad - Proccesed");
                        SetUserHouse(playerid);
                        print("Blad - Proccesed");
                        ShowInfoDialog(playerid, "House - Info", "You successfully bought the house, use /house to manage it.");
                        SaveHouse(h);
                        print("Blad - Proccesed");
                        SaveAccount(playerid);
                        print("Blad - Proccesed");
                        CheckUserAchievement(playerid, ACHIEVEMENT_HOUSE, true);
                        print("Blad - Proccesed");
                    }
                    else ShowInfoDialog(playerid, "House - Info", "You can't afford it");
                }
                else ShowInfoDialog(playerid, "House - Info", "Someone already owns this house");
            }
            else ShowInfoDialog(playerid, "Error!", "You arent even near a house");
            print("Server distance housing properly");
        }
        print("Server checked housing properly");
        return 1;
    }
I've tried all of this, and it seems like, it only reached checking distance properly, but it seems to spam the console, can there be anything wrong this this?
Reply


Messages In This Thread
House - Buy - by Riddy - 22.09.2012, 12:11
Re: House - Buy - by Riddy - 25.09.2012, 19:44
Re : House - Buy - by Varkoll_ - 25.09.2012, 19:55
Re : House - Buy - by Varkoll_ - 25.09.2012, 20:03
Re: Re : House - Buy - by Riddy - 25.09.2012, 20:50
Re : House - Buy - by Varkoll_ - 25.09.2012, 20:59
Re: Re : House - Buy - by Riddy - 26.09.2012, 11:13
Re : House - Buy - by Varkoll_ - 26.09.2012, 17:07
Re: House - Buy - by Riddy - 08.10.2012, 20:04
Re : House - Buy - by lelemaster - 08.10.2012, 20:31

Forum Jump:


Users browsing this thread: 1 Guest(s)