house system GivePlayerMoney
#1

The GivePlayerMoney doesn't work for this /buyhouse command. It also doesn't set the owner when typing /buyhouse, so you can't /sellhouse because it don't set the owner!

pawn Код:
CMD:buyhouse(playerid, params[])
    {
    new string[100], owner[30], ID;
    if(sscanf(params, "d", ID)) return UsageMessage(pid, "/buyhouse [houseaddress]");
    if(!IsPlayerInRangeOfPoint(pid, 5.5, HouseInfo[ID][hextX], HouseInfo[ID][hextY], HouseInfo[ID][hextZ])) return SCM(pid, COLRED, "Server: {F0F0F0}You are not in range of house!");
    if(GetPlayerMoney(playerid) >= HouseInfo[ID][hPrice])
        {
        if(strmatch(HouseInfo[ID][hOwner], "None"))
            {
            new price = HouseInfo[ID][hPrice];
            GivePlayerMoney(playerid, - price);
            format(owner, sizeof(owner), "%s", GetName(playerid));
            HouseInfo[ID][hOwner] = owner;
            Delete3DTextLabel(HouseInfo[ID][hLabel]);
            format(string, sizeof(string), "%House\nAddress: %d", ID);
            HouseInfo[ID][hLabel] = Create3DTextLabel(string, COLBLUE, HouseInfo[ID][hextX], HouseInfo[ID][hextY], HouseInfo[ID][hextZ], 20.0, 0, 1);
            }
        else return SCM(pid, COLRED, "Server: {f0f0f0}this house is owned.");
        }
    else
        {
        SCM(pid, COLRED, "Server: {f0f0f0}You don't have enough money.");
        }
    return 1;
    }
Reply


Messages In This Thread
house system GivePlayerMoney - by Mattakil - 10.10.2013, 01:59
Re: house system GivePlayerMoney - by iGetty - 10.10.2013, 05:21
Re: house system GivePlayerMoney - by Mattakil - 11.10.2013, 20:18
Re: house system GivePlayerMoney - by Patrick - 11.10.2013, 20:25
Re: house system GivePlayerMoney - by Mattakil - 11.10.2013, 21:09
Re: house system GivePlayerMoney - by Patrick - 11.10.2013, 21:15
Re: house system GivePlayerMoney - by edzis84 - 11.10.2013, 21:30
Re: house system GivePlayerMoney - by Mattakil - 11.10.2013, 22:07
Re: house system GivePlayerMoney - by edzis84 - 11.10.2013, 22:11

Forum Jump:


Users browsing this thread: 2 Guest(s)