Trying to store armour, what am I doing wrong?
#1

pawn Код:
if(!strcmp(item, "armour", true))
            {
                HouseArmour[houseid] = MySQL_GetValue(houseid, "HouseArmour", "houses");
                PlayerArmour[playerid] = GetPlayerArmour(playerid, PlayerArmour[playerid]);

                if(sscanf(params, "s[24]s[32]d",usage,item,slot))
                {
                    SendClientMessage(playerid, COLOUR_GREY, "Usage: /house store armour [amount]");
                    return 1;
                }

                if(slot < 1 || slot > 100)
                    return SendClientMessage(playerid, COLOUR_GREY, "Amount must be between 0 and 100");
                if(slot > PlayerArmour[playerid])
                    return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much armour");

                HouseArmour[houseid] = HouseArmour[houseid] += slot;
                PlayerArmour[playerid] = PlayerArmour[playerid] -= slot;
                SetPlayerArmour(playerid, -slot);

                MySQL_SetFloat(houseid, "HouseArmour", HouseArmour[houseid], "houses");
                MySQL_SetFloat(PlayerSQLID[playerid], "Armour", PlayerArmour[playerid], "accounts");

                format(string, sizeof(string), "You have stored %d of armour, you now have a total of: %d armour in your house", slot, HouseArmour[houseid]);
                SendClientMessage(playerid, COLOUR_BLUE, string);
                format(string, sizeof(string), "* %s has stored some armour in their house.", GetNameEx(playerid));
                ProxDetector(30.0, playerid, string, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE);
            }
On MYSQL armour is a Float. I'm trying to save it in a house.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)