What am I doing wrong here, Armour Saving.
#1

pawn Код:
if(!strcmp(item, "armour", true))
            {
                new armour;
                PlayerArmour[playerid] = GetPlayerArmour(playerid, PlayerArmour[playerid]);
                if(sscanf(params, "s[24]s[32]d",usage,item,armour))
                {
                    SendClientMessage(playerid, COLOUR_GREY, "Usage: /house store armour [amount]");
                    return 1;

                }
                if(armour > PlayerArmour[playerid]) return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much armour");
                HouseArmour[houseid] = HouseArmour[playerid] += armour;
                PlayerArmour[playerid] = PlayerArmour[playerid] -= armour;
                SetPlayerArmour(playerid, PlayerArmour[playerid]);
                MySQL_SetFloat(houseid, "HouseArmour", HouseArmour[houseid], "houses");
                MySQL_SetFloat(PlayerSQLID[playerid], "Armour", PlayerArmour[playerid], "accounts");
                format(string, sizeof(string), "You have stored %f of armour, you now have a total of: %f armour in your house", armour, 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);
            }
Reply
#2

Change this

Код:
SetPlayerArmour(playerid, PlayerArmour[playerid]);
to this

Код:
SetPlayerArmour(playerid, -PlayerArmour[playerid]);
Reply
#3

try this:
pawn Код:
if(!strcmp(item, "armour", true))
            {
                new armour;
                PlayerArmour[playerid] = GetPlayerArmour(playerid, PlayerArmour[playerid]);
                if(sscanf(params, "s[24]s[32]d",usage,item,armour))
                {
                    SendClientMessage(playerid, COLOUR_GREY, "Usage: /house store armour [amount]");
                    return 1;

                }
                if(armour > PlayerArmour[playerid]) return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much armour");
                HouseArmour[houseid] = HouseArmour[playerid] += armour;
                PlayerArmour[playerid] = PlayerArmour[playerid] -= armour;
                SetPlayerArmour(playerid, -PlayerArmour[playerid]);
                MySQL_SetFloat(houseid, "HouseArmour", HouseArmour[houseid], "houses");
                MySQL_SetFloat(PlayerSQLID[playerid], "Armour", PlayerArmour[playerid], "accounts");
                format(string, sizeof(string), "You have stored %f of armour, you now have a total of: %f armour in your house", armour, 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);
            }
Reply
#4

Checking it, Thanks!
Reply
#5

Aren't you getting a tag mismatch anywhere?
Reply
#6

I'm not, PlayerArmour is a Float. I'm not sure why it will not store.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)