25.11.2012, 16:00
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);
}