21.06.2015, 14:40
PHP код:
new info = PlayerInfo[playerid][pHouseID];
if(!response)
{
if(strval(inputtext) > 100000) return SendClientMessage(playerid, COLOR_RED, "You can't put in your house's storge more than 100000$");
else if(strval(inputtext) < 100000)
{
if(strval(inputtext) > GetPlayerMoney(playerid)) return SendClientMessage(playerid, COLOR_RED, "You don't have this amount of money!");
new query[128];
new equal = result += strval(inputtext);
if(equal > 100000) return SendClientMessage(playerid, COLOR_RED, "Maxmium money in the storge has reached!");
format(query, sizeof(query), "UPDATE houses SET storge='%i' WHERE id='%i'",equal, PlayerInfo[playerid][pHouseID]);
mysql_query(1, query);
GivePlayerMoney(playerid, -strval(inputtext));
HouseInfo[info][storge] = equal;
}
else return SendClientMessage(playerid, COLOR_RED, "Input a number!");
}
else
{
if(strval(inputtext) > HouseInfo[info][storge]) return SendClientMessage(playerid, COLOR_RED, "You don't have money in your storge!");
else if(strval(inputtext) < HouseInfo[info][storge])
{
new query[129];
new result = HouseInfo[info][storge];
new equal = result -= strval(inputtext);
format(query, sizeof(query), "UPDATE houses SET storge='%i' WHERE id='%i'",equal, PlayerInfo[playerid][pHouseID]);
mysql_query(1, query);
GivePlayerMoney(playerid, strval(inputtext));
HouseInfo[info][storge] = equal;
}
else return SendClientMessage(playerid, COLOR_RED, "Input a number!");
}