Guten Abend,
Ich bin kurz vor der Verzweiflung ich hab jetzt wirklich alles probiert und umgeschrieben und trotzdem Ist der "Bug" immer noch da.
Mein Problem ist Wenn ich Ingame ein Haus erstelle und den Server mit gmx neustarte erstellt der Server automatisch eine kopie von dem Haus also sieht es Quasi so in meiner Konsole aus nach dem Neustart
und so in der Datenbank
Ich habe wirklich Jede Funktion einmal neu geschrieben / raus genommen um zu gucken an was es liegen könnte meine Vermutung ist GetFreeHouseID
GetFreeHouseID()
{
for(new i = 0; i < sizeof(HouseInfo); i ++)
{
if(HouseInfo[i][h_ID] == 0)return i;
}
return 0;
}
Hab dort aber auch wirklich alles versucht sogar mir printen lassen und ab einem bestimmten punkt kommt er halt nicht weiter und das ist halt bei GetFreeHouseID
Es kommt in die Schleife rein aber "if(HouseInfo[i][h_ID] == 0)return i;" wird anscheind nicht aufgerufen beim Command
Hier auch mal der Command
ocmd:createhouse(playerid, params[])
{
if(pInfo[playerid][pAdmin] < 4)return 1;
new InteriorTypeID, InteriorID, HouseType, HousePrice, HouseGarage, string[256];
new Float: InteriorX, Float: InteriorY, Float: InteriorZ, Float: EnterX, Float: EnterY, Float: EnterZ;
if(sscanf(params, "iii", InteriorTypeID, HousePrice, HouseGarage))
{
SendClientMessage(playerid, COLOR_SAMP1, "* Usage: /createhouse [InteriorID] [Price] [Garage (0 = Nein | 1 = Ja)]");
SendClientMessage(playerid, COLOR_SAMP1, "* InteriorIDs: Small[1 - 11] | Medium[12- 32] | Big[33-36]");
return 1;
}
if(InteriorTypeID < 1 || InteriorTypeID > 36)return SendClientMessage(playerid, COLOR_RED, "* Error: Ungültige InteriorID! (1 - 36)");
/*====================> [ #SMALL INTERIORS ] <====================*/
if(InteriorTypeID == 1) { InteriorX = 223.0797, InteriorY = 1287.7438, InteriorZ = 1082.1406; InteriorID = 1; HouseType = 0; }
if(InteriorTypeID == 2) { InteriorX = 2282.7927, InteriorY = -1139.3999, InteriorZ = 1050.8984; InteriorID = 11; HouseType = 0; }
if(InteriorTypeID == 3) { InteriorX = 328.0025, InteriorY = 1478.5465, InteriorZ = 1084.4375; InteriorID = 15; HouseType = 0; }
if(InteriorTypeID == 4) { InteriorX = -42.5438, InteriorY = 1406.3199, InteriorZ = 1084.4297; InteriorID = 8; HouseType = 0; }
if(InteriorTypeID == 5) { InteriorX = 300.8615, InteriorY = 309.8871, InteriorZ = 1003.3047; InteriorID = 4; HouseType = 0; }
if(InteriorTypeID == 6) { InteriorX = 2308.8101, InteriorY = -1212.2432, InteriorZ = 1049.0234; InteriorID = 6; HouseType = 0; }
if(InteriorTypeID == 7) { InteriorX = 2233.6196, InteriorY = -1114.5808, InteriorZ = 1050.8828; InteriorID = 5; HouseType = 0; }
if(InteriorTypeID == 8) { InteriorX = 2259.8242, InteriorY = -1135.7554, InteriorZ = 1050.6328; InteriorID = 10; HouseType = 0; }
if(InteriorTypeID == 9) { InteriorX = 2217.8169, InteriorY = -1076.1425, InteriorZ = 1050.4844; InteriorID = 1; HouseType = 0; }
if(InteriorTypeID == 10) { InteriorX = 267.1584, InteriorY = 305.2281, InteriorZ = 999.1484; InteriorID = 2; HouseType = 0; }
if(InteriorTypeID == 11) { InteriorX = 244.1047, InteriorY = 304.9235, InteriorZ = 999.1484; InteriorID = 1; HouseType = 0; }
/*====================> [ #MEDIUM INTERIORS ] <====================*/
if(InteriorTypeID == 12) { InteriorX = 235.4070, InteriorY = 1187.3690, InteriorZ = 1080.2578; InteriorID = 3; HouseType = 1; }
if(InteriorTypeID == 13) { InteriorX = 490.8654, InteriorY = 1399.1970, InteriorZ = 1080.2578; InteriorID = 2; HouseType = 1; }
if(InteriorTypeID == 14) { InteriorX = 24.0680, InteriorY = 1340.5543, InteriorZ = 1084.3750; InteriorID = 10; HouseType = 1; }
if(InteriorTypeID == 15) { InteriorX = -283.9743, InteriorY = 1471.1327, InteriorZ = 1084.3750; InteriorID = 15; HouseType = 1; }
if(InteriorTypeID == 16) { InteriorX = -261.2778, InteriorY = 1456.7443, InteriorZ = 1084.3672; InteriorID = 4; HouseType = 1; }
if(InteriorTypeID == 17) { InteriorX = 83.0025, InteriorY = 1322.8451, InteriorZ = 1083.8662; InteriorID = 9; HouseType = 1; }
if(InteriorTypeID == 18) { InteriorX = 2317.9451, InteriorY = -1026.1736, InteriorZ = 1050.2178; InteriorID = 9; HouseType = 1; }
if(InteriorTypeID == 19) { InteriorX = 2496.0198, InteriorY = -1692.6827, InteriorZ = 1014.7422; InteriorID = 3; HouseType = 1; }
if(InteriorTypeID == 20) { InteriorX = 2196.0349, InteriorY = -1204.3772, InteriorZ = 1049.0234; InteriorID = 6; HouseType = 1; }
if(InteriorTypeID == 21) { InteriorX = 376.2806, InteriorY = 1417.5321, InteriorZ = 1081.3281; InteriorID = 15; HouseType = 1; }
if(InteriorTypeID == 22) { InteriorX = 2269.6677, InteriorY = -1210.3624, InteriorZ = 1047.5625; InteriorID = 10; HouseType = 1; }
if(InteriorTypeID == 23) { InteriorX = 447.3249, InteriorY = 1397.5758, InteriorZ = 1084.3047; InteriorID = 2; HouseType = 1; }
if(InteriorTypeID == 24) { InteriorX = 386.5427, InteriorY = 1471.8826, InteriorZ = 1080.1875; InteriorID = 15; HouseType = 1; }
if(InteriorTypeID == 25) { InteriorX = 22.8908, InteriorY = 1403.7777, InteriorZ = 1084.4297; InteriorID = 5; HouseType = 1; }
if(InteriorTypeID == 26) { InteriorX = 2365.3372, InteriorY = -1134.8403, InteriorZ = 1050.8750; InteriorID = 8; HouseType = 1; }
if(InteriorTypeID == 27) { InteriorX = 2237.6023, InteriorY = -1080.8840, InteriorZ = 1049.0234; InteriorID = 2; HouseType = 1; }
if(InteriorTypeID == 28) { InteriorX = 295.0533, InteriorY = 1473.0192, InteriorZ = 1080.2578; InteriorID = 15; HouseType = 1; }
if(InteriorTypeID == 29) { InteriorX = 221.9701, InteriorY = 1140.8445, InteriorZ = 1082.6094; InteriorID = 4; HouseType = 1; }
if(InteriorTypeID == 30) { InteriorX = -68.7771, InteriorY = 1351.9674, InteriorZ = 1080.2109; InteriorID = 6; HouseType = 1; }
if(InteriorTypeID == 31) { InteriorX = 260.8823, InteriorY = 1237.9570, InteriorZ = 1084.2578; InteriorID = 9; HouseType = 1; }
if(InteriorTypeID == 32) { InteriorX = 2468.4509, InteriorY = -1698.2510, InteriorZ = 1013.5078; InteriorID = 2; HouseType = 1; }
/*====================> [ #BIG INTERIORS ] <====================*/
if(InteriorTypeID == 33) { InteriorX = 140.1820, InteriorY = 1366.4713, InteriorZ = 1083.8594; InteriorID = 5; HouseType = 2; }
if(InteriorTypeID == 34) { InteriorX = 225.6624, InteriorY = 1022.0758, InteriorZ = 1084.0159; InteriorID = 7; HouseType = 2; }
if(InteriorTypeID == 35) { InteriorX = 234.2033, InteriorY = 1064.1516, InteriorZ = 1084.2117; InteriorID = 6; HouseType = 2; }
if(InteriorTypeID == 36) { InteriorX = 226.7048, InteriorY = 1114.2527, InteriorZ = 1080.9950; InteriorID = 5; HouseType = 2; }
/*====================> [ #CREATE HOUSE ] <====================*/
new id = GetFreeHouseID();
GetPlayerPos(playerid, EnterX, EnterY, EnterZ);
HouseInfo[id][hEnterX] = EnterX;
HouseInfo[id][hEnterY] = EnterY;
HouseInfo[id][hEnterZ] = EnterZ;
HouseInfo[id][hExitX] = InteriorX;
HouseInfo[id][hExitY] = InteriorY;
HouseInfo[id][hExitZ] = InteriorZ;
HouseInfo[id][hInteriorID] = InteriorID;
HouseInfo[id][hVirtualWorldID] = 0;
HouseInfo[id][hPrice] = HousePrice;
HouseInfo[id][hType] = HouseType;
HouseInfo[id][hGarage] = HouseGarage;
UpdateHouses(id);
new HouseTypeName[64], GarageName[64];
switch(HouseType)
{
case 0: HouseTypeName = "Klein";
case 1: HouseTypeName = "Medium";
case 2: HouseTypeName = "Groß";
}
switch(HouseGarage)
{
case 0: GarageName = "Nein";
case 1: GarageName = "Ja";
}
mysql_format(handle, query, sizeof(query), "INSERT INTO `housedata` (EnterPosX, EnterPosY, EnterPosZ, ExitPosX, ExitPosY, ExitPosZ, Interior, VirtualWorld, Price, Type, Garage) VALUES ('%f', '%f', '%f', '%f', '%f', '%f', '%i', '%i', '%i', '%i', '%i')",
HouseInfo[id][hEnterX], HouseInfo[id][hEnterY], HouseInfo[id][hEnterZ], HouseInfo[id][hExitX], HouseInfo[id][hExitY], HouseInfo[id][hExitZ], HouseInfo[id][hInteriorID], HouseInfo[id][hVirtualWorldID], HouseInfo[id][hPrice], HouseInfo[id][hType], HouseInfo[id][hGarage]);
printf("%s", query);
mysql_tquery(handle, query, "HouseCreated", "i", id);
format(string, sizeof(string), "[AdmCmd] %s hat ein Haus erstellt. (Preis: $%s | Typ: %s | InteriorID: %i | Garage: %s)", pInfo[playerid][pName], NiceMoney(HouseInfo[id][hPrice]), HouseTypeName, InteriorID, GarageName);
SendAdminMessage(COLOR_LIGHTBLUE, string);
return 1;
}
Hoffe mir kann jemand Helfen..