Hi,
MySQL Log:
[14:14:46] [DEBUG] mysql_option - option: 1, value: 0[14:14:46] [DEBUG] mysql_connect - host: "127.0.0.1", user: "root", database: "new_rl", password: "****", port: 3306, autoreconnect: true, pool_size: 2[14:14:46] [DEBUG] CMySQLHandle::Create - creating new connection..[14:14:46] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called[14:14:46] [DEBUG] CMySQLHandle::Create - connection created (id: 1)[14:14:46] [DEBUG] CMySQLConnection::Connect - establishing connection to database...[14:14:46] [DEBUG] CMySQLConnection::Connect - connection was successful[14:14:46] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled[14:14:46] [DEBUG] mysql_errno - connection: 1[14:14:46] [DEBUG] CMySQLConnection::Connect - establishing connection to database...[14:14:46] [DEBUG] CMySQLConnection::Connect - connection was successful[14:14:46] [DEBUG] CMySQLConnection::Connect - connection was successful[14:14:46] [DEBUG] CMySQLConnection::Connect - connection was successful[14:14:46] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled[14:14:47] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM Kassen ORDER BY ID ASC", callback: "LoadKassen", format: "d"[14:14:47] [DEBUG] mysql_tquery - connection: 1, query: "CREATE TABLE IF NOT EXISTS `House` (`ID` int(11) NOT NULL PRIMARY KEY, `Besitzer` varchar(24) NOT NULL DEFAULT '0', `Level` int(11) NOT NULL DEFAULT '0', `PosX` float NOT NULL DEFAULT '0', `PosY` float NOT NULL DEFAULT '0', `PosZ` float NOT NULL DEFAULT '0', `IntX` float NOT NULL DEFAULT '0', `IntY` float NOT NULL DEFAULT '0', `IntZ` float NOT NULL DEFAULT '0', `IntID` int(11) NOT NULL DEFAULT '0', `VID` int(11) NOT NULL DEFAULT '0', `Locked` int(11) NOT NULL DEFAULT '0', `Mietpreis` int(11) NOT NULL DEFAULT '0', `Kaufpreis` int(11) NOT NULL DEFAULT '0', `Gekauft` int(11) NOT NULL DEFAULT '0') ENGINE=InnoDB DEFAULT CHARSET=latin1;", callback: "(null)", format: "(null)"[14:14:47] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM Hausdaten ORDER BY ID ASC", callback: "LoadHouse_Data", format: "(null)"[14:14:47] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM Auto", callback: "LoadVehicles_Data", format: "(null)"[14:14:47] [DEBUG] CMySQLQuery::Execute[LoadKassen] - starting query execution[14:14:47] [DEBUG] CMySQLQuery::Execute[LoadKassen] - query was successfully executed within 0.591 milliseconds[14:14:47] [DEBUG] CMySQLResult::CMySQLResult() - constructor called[14:14:47] [DEBUG] CMySQLQuery::Execute[] - starting query execution[14:14:47] [DEBUG] CMySQLQuery::Execute[] - query was successfully executed within 0.635 milliseconds[14:14:47] [DEBUG] Calling callback "LoadKassen"..[14:14:47] [DEBUG] CMySQLQuery::Execute[] - no callback specified, skipping result saving[14:14:47] [DEBUG] cache_get_row_count - connection: 1[14:14:47] [DEBUG] CMySQLQuery::Execute[LoadHouse_Data] - starting query executionn: 1[14:14:47] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "ID", data: "0"[14:14:47] [ERROR] CMySQLQuery::Execute[LoadHouse_Data] - (error #1146) Table 'new_rl.hausdaten' doesn't exist[14:14:47] [DEBUG] CMySQLQuery::Execute[LoadHouse_Data] - error will be triggered in OnQueryError[14:14:47] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO Kassen (ID, Name) VALUES ('1', 'Staatskasse')", callback: "(null)", format: "(null)"[14:14:47] [DEBUG] cache_get_field_content_int - row: 0, field_name: "ID", connection: 1[14:14:47] [DEBUG] CMySQLQuery::Execute[LoadVehicles_Data] - starting query execution[14:14:47] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "ID", data: "0"[14:14:47] [DEBUG] CMySQLQuery::Execute[LoadVehicles_Data] - query was successfully executed within 0.795 milliseconds[14:14:47] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO Kassen (ID, Name) VALUES ('2', 'Test1')", callback: "(null)", format: "(null)"[14:14:47] [DEBUG] CMySQLResult::CMySQLResult() - constructor called[14:14:47] [DEBUG] cache_get_field_content_int - row: 0, field_name: "ID", connection: 1[14:14:47] [DEBUG] CMySQLQuery::Execute[] - starting query execution[14:14:47] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "ID", data: "0"[14:14:47] [ERROR] CMySQLQuery::Execute[] - (error #1062) Duplicate entry '1' for key 'PRIMARY'[14:14:47] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO Kassen (ID, Name) VALUES ('3', 'Fahrschule')", callback: "(null)", format: "(null)"[14:14:47] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError[14:14:47] [DEBUG] CMySQLQuery::Execute[] - starting query execution[14:14:47] [DEBUG] cache_get_field_content_int - row: 0, field_name: "ID", connection: 1[14:14:47] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "ID", data: "0"[14:14:47] [ERROR] CMySQLQuery::Execute[] - (error #1062) Duplicate entry '2' for key 'PRIMARY'[14:14:47] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO Kassen (ID, Name) VALUES ('4', 'News')", callback: "(null)", format: "(null)"[14:14:47] [DEBUG] cache_get_field_content_int - row: 0, field_name: "ID", connection: 1[14:14:47] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "ID", data: "0"[14:14:47] [ERROR] CMySQLQuery::Execute[] - (error #1062) Duplicate entry '3' for key 'PRIMARY'[14:14:47] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError) VALUES ('5', 'ADAC')", callback: "(null)", format: "(null)"[14:14:47] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called[14:14:47] [DEBUG] Calling callback "OnQueryError"..[14:14:47] [ERROR] CMySQLQuery::Execute[] - (error #1062) Duplicate entry '4' for key 'PRIMARY'[14:14:47] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError
Serverlog:
[14:14:46] MySQL: Die Verbindung wurde erfolgreich hergestellt.[14:14:47] query: CREATE TABLE IF NOT EXISTS `House` (`ID` int(11) NOT NULL PRIMARY KEY, `Besitzer` varchar(24) NOT NULL DEFAULT '0', `Level` int(11) NOT NULL DEFAULT '0', `PosX` float NOT NULL DEFAULT '0', `PosY` float NOT NULL DEFAULT '0', `PosZ` float NOT NULL DEFAULT '0', `IntX` float NOT NULL DEFAULT '0', `IntY` float NOT NULL DEFAULT '0', `IntZ` float NOT NULL DEFAULT '0', `IntID` int(11) NOT NULL DEFAULT '0', `VID` int(11) NOT NULL DEFAULT '0', `Locked` int(11) NOT NULL DEFAULT '0', `Mietpreis` int(11) NOT NULL DEFAULT '0', `Kaufpreis` int(11) NOT NULL DEFAULT '0', `Gekauft` int(11) NOT NULL DEFAULT '0') ENGINE=InnoDB DEFAULT CHARSET=latin1;[14:14:47]
Die Pickups erstelle ich unter OnGameModeInit nach dem die Häuser geladen werden, soll ich den Code:
for(new i=0; i<MAX_HOUSE; i++)
{
if(hInfo[i][Gekauft] == 0)
{
new text[128];
format(text, sizeof(text), "Besitzer: Niemand\nPreis: %d\nLevel: %d",hInfo[i][Kaufpreis],hInfo[i][Level]);
Create3DTextLabel(text,0x0FFF00FF,hInfo[i][PosX],hInfo[i][PosY],hInfo[i][PosZ],20.0,0,1);
CreatePickup(1273,1,hInfo[i][PosX],hInfo[i][PosY],hInfo[i][PosZ],1);
}
else if(hInfo[i][Gekauft] == 1)
{
new text[128];
format(text, sizeof(text), "Besitzer: %s\nMiete: %d\nLevel: %d",hInfo[i][Besitzer],hInfo[i][Mietpreis],hInfo[i][Level]);
Create3DTextLabel(text,0xB90000FF,hInfo[i][PosX],hInfo[i][PosY],hInfo[i][PosZ],20.0,0,1);
CreatePickup(1273,1,hInfo[i][PosX],hInfo[i][PosY],hInfo[i][PosZ],1);
}
}
Bei LoadHouse_Data hinzufügen?
Jeffry:
Mit freundlichen Grüßen