31.05.2015, 09:39
hello i got a problem when i creaete a house i need to restart the server to edit it or buy etc..
plz help
this is my SaveHouse Function
sorry for my bad english
plz help
this is my SaveHouse Function
pawn Код:
stock SaveHouse(Float:ExtX, Float:ExtY, Float:ExtZ, Float:IntX, Float:IntY, Float:IntZ, IntID, RWorld)
{
new
id,
string[512],
Query[2000],
hID,
hName[128],
hOwner[24],
Float:ExtX,
Float:ExtY,
Float:ExtZ,
Float:IntX,
Float:IntY,
Float:IntZ,
Price,
IntID,
Locked,
World;
mysql_format(mysql, Query, sizeof(Query), "INSERT INTO `Houses` (`HouseName`, `HouseOwner`, `ExteriorX`, `ExteriorY`, `ExteriorZ`, `InteriorX`, `InteriorY`, `InteriorZ`, `InteriorID`, `HousePrice`, `HouseLocked`, `HouseWorld`) VALUES('NotSet', 'Nobody', '%f', '%f', '%f', '%f', '%f', '%f', '%i', '25000', '0', '%i')", ExtX, ExtY, ExtZ, IntX, IntY, IntZ, IntID, RWorld);
mysql_query(mysql, Query);
mysql_free_result();
hInfo[id][HouseID] = hID;
hInfo[id][HouseExteriorX] = ExtX;
hInfo[id][HouseExteriorY] = ExtY;
hInfo[id][HouseExteriorZ] = ExtZ;
hInfo[id][HouseInteriorX] = IntX;
hInfo[id][HouseInteriorY] = IntY;
hInfo[id][HouseInteriorZ] = IntZ;
hInfo[id][HouseInteriorID] = IntID;
hInfo[id][HousePrice] = Price;
hInfo[id][HouseLocked] = Locked;
hInfo[id][HouseWorld] = World;
HousePickup[id] = CreatePickup(1273, 1, ExtX, ExtY, ExtZ, 0);
format(hInfo[id][HouseName], 128, "%s", hName);
format(hInfo[id][HouseOwner], 24, "%s", hOwner);
format(string, sizeof(string), "{3366FF}%s\nID: {FFFFFF}%d", hName, hInfo[id][HouseID]);
HouseLabel[id] = Create3DTextLabel(string, COLOR_BLUE, ExtX, ExtY, ExtZ, 5.0, 0, 1);
return 1;
}