- 0
Problema salvare mysql
-
Similar Content
-
Recently Browsing 0 members
- No registered users viewing this page.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.
Question
seveigibaibi
Salut, cand cumpar o casa sau un business nu se salveaza in baza de date, am modificat ceva prin script dar nu-mi mai amintesc ce.
Poze:
Cand cumpar o casa imi arata ca am cumparat-o si pot s-o cumpar de mai multe ori.
CMD:buy(playerid, params[]) { static id = -1; if ((id = House_Nearest(playerid)) != -1) { if (House_GetCount(playerid) >= MAX_OWNABLE_HOUSES) return SendErrorMessage(playerid, "You can only own %d houses at a time.", MAX_OWNABLE_HOUSES); if (HouseData[id][houseOwner] != 0) return SendErrorMessage(playerid, "This house is already owned at the moment."); if (HouseData[id][housePrice] > GetMoney(playerid)) return SendErrorMessage(playerid, "You have insufficient funds for the purchase."); HouseData[id][houseOwner] = GetPlayerSQLID(playerid); House_Refresh(id); House_Save(id); GiveMoney(playerid, -HouseData[id][housePrice]); SendServerMessage(playerid, "Ai cumparat casa \"%s\" pentru %s!", HouseData[id][houseAddress], FormatNumber(HouseData[id][housePrice])); SendClientMessageEx(playerid, COLOR_GREEN, "Ai cumparat aceasta casa!"); Log_Write("logs/house_log.txt", "[%s] %s a cumparat casa ID: %d pentru %s.", ReturnDate(), ReturnName(playerid), id, FormatNumber(HouseData[id][housePrice])); } if ((id = Garage_Nearest(playerid)) != -1) { if (Garage_GetCount(playerid) >= MAX_OWNABLE_GARAGES) return SendErrorMessage(playerid, "You can only own %d garages at a time.", MAX_OWNABLE_GARAGES); if (GarageData[id][garageOwner] != 0) return SendErrorMessage(playerid, "This garage is already owned at the moment."); if (GarageData[id][garagePrice] > GetMoney(playerid)) return SendErrorMessage(playerid, "You have insufficient funds for the purchase."); GarageData[id][garageOwner] = GetPlayerSQLID(playerid); Garage_Refresh(id); Garage_Save(id); GiveMoney(playerid, -GarageData[id][garagePrice]); SendServerMessage(playerid, "Ai cumparat garajul \"%s\" pentru %s!", GarageData[id][garageAddress], FormatNumber(GarageData[id][garagePrice])); SendClientMessageEx(playerid, COLOR_GREEN, "Ai cumparat aceast garaj!"); Log_Write("logs/garage_log.txt", "[%s] %s a cumparat garajul ID: %d pentru %s.", ReturnDate(), ReturnName(playerid), id, FormatNumber(GarageData[id][garagePrice])); } else if ((id = Business_Nearest(playerid)) != -1) { if (Business_GetCount(playerid) >= MAX_OWNABLE_BUSINESSES) return SendErrorMessage(playerid, "You can only own %d businesses at a time.", MAX_OWNABLE_BUSINESSES); if (BusinessData[id][bizOwner] != 0) return SendErrorMessage(playerid, "This business is already owned at the moment."); if (BusinessData[id][bizPrice] > GetMoney(playerid)) return SendErrorMessage(playerid, "You have insufficient funds for the purchase."); BusinessData[id][bizOwner] = GetPlayerSQLID(playerid); Business_Refresh(id); Business_Save(id); GiveMoney(playerid, -BusinessData[id][bizPrice]); SendServerMessage(playerid, "Ai cumparat business-ul \"%s\" pentru %s!", BusinessData[id][bizName], FormatNumber(BusinessData[id][bizPrice])); SendClientMessageEx(playerid, COLOR_GREEN, "Ai cumparat acest business!"); Log_Write("logs/biz_log.txt", "[%s] %s a cumparat business ID: %d pentru %s.", ReturnDate(), ReturnName(playerid), id, FormatNumber(BusinessData[id][bizPrice])); } else if ((id = Business_Inside(playerid)) != -1) { if (BusinessData[id][bizLocked] != 0 || !BusinessData[id][bizOwner]) return SendErrorMessage(playerid, "This business is closed!"); if (BusinessData[id][bizType] == 5) { Business_CarMenu(playerid, id); } else { Business_PurchaseMenu(playerid, id); } } return 1; }
Edited by seveigibaibi11 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now