Adidas_Dagestanec |
Дата: Суббота, 29.10.2016, 11:34 | Сообщение # 1
|
Любитель
Сообщений: 48
Статус: Offline
|
Создаю дом, все норм, после рестарта слетают созданные дома. А точнее их интерьер, цена, класс.
Код CMD:addhouse(playerid, params[]) { if(!CheckAdminLevel(playerid,10)) return true; if(sscanf(params, "ddd",params[0],params[1],params[2])) { SendClientMessage(playerid, -1, "Ââåäèòå: /addhouse [êëàññ] [öåíà] [ãàðàæ 0 - íåò | 1- äà]"); SendClientMessage(playerid,-1,"0 - [Nope] | 1 - [D] | 2 - [C] | 3 - [B] | 4 - [A] | 5 - [S]"); return true; } new Float: posX, Float: posY, Float: posZ; GetPlayerPos(playerid, posX, posY, posZ); mysql_format(DATABASE,QUERY, 256, "INSERT INTO `house` (`hEntrancex`, `hEntrancey`,`hEntrancez`, `hLock`,`hKlass`) VALUES ('%f', '%f', '%f', '1','%i' <img src="/.s/sm/2/wink.gif" border="0" align="absmiddle" alt="wink" /> ",posX,posY,posZ,params[0]); mysql_function_query(DATABASE,QUERY,false,"",""); TotalHouse++; HouseInfo[TotalHouse][hID] = TotalHouse; HouseInfo[TotalHouse][hEntrancex] = posX; HouseInfo[TotalHouse][hEntrancey] = posY; HouseInfo[TotalHouse][hEntrancez] = posZ; HouseInfo[TotalHouse][hLock] = 1; HouseInfo[TotalHouse][hKlass] = params[0]; HouseInfo[TotalHouse][hValue] = params[1]; if(HouseInfo[TotalHouse][hKlass] == 0) { HouseInfo[TotalHouse][hInt] = 10; HouseInfo[TotalHouse][hExitx] = 421.7613; HouseInfo[TotalHouse][hExity] = 2536.4836; HouseInfo[TotalHouse][hExitz] = 10.0000; } else if(HouseInfo[TotalHouse][hKlass] == 1) { HouseInfo[TotalHouse][hInt] = 6; HouseInfo[TotalHouse][hExitx] = -68.8618; HouseInfo[TotalHouse][hExity] = 1352.2183; HouseInfo[TotalHouse][hExitz] = 1080.2109; } else if(HouseInfo[TotalHouse][hKlass] == 2) { HouseInfo[TotalHouse][hInt] = 5; HouseInfo[TotalHouse][hExitx] = 22.7405; HouseInfo[TotalHouse][hExity] = 1404.3799; HouseInfo[TotalHouse][hExitz] = 1084.4297; } else if(HouseInfo[TotalHouse][hKlass] == 3) { HouseInfo[TotalHouse][hInt] = 12; HouseInfo[TotalHouse][hExitx] = 2324.3367; HouseInfo[TotalHouse][hExity] = -1148.6296; HouseInfo[TotalHouse][hExitz] = 1050.7101; } else { HouseInfo[TotalHouse][hInt] = 5; HouseInfo[TotalHouse][hExitx] = 140.2206; HouseInfo[TotalHouse][hExity] = 1367.2734; HouseInfo[TotalHouse][hExitz] = 1083.8612; } HouseInfo[TotalHouse][hGarage] = params[2]; HouseInfo[TotalHouse][hPickup] = CreatePickup(1273, 23, HouseInfo[TotalHouse][hEntrancex], HouseInfo[TotalHouse][hEntrancey], HouseInfo[TotalHouse][hEntrancez],-1); HouseInfo[TotalHouse][hMIcon] = CreateDynamicMapIcon(HouseInfo[TotalHouse][hEntrancex], HouseInfo[TotalHouse][hEntrancey], HouseInfo[TotalHouse][hEntrancez], 31, -1, 0, -1, -1); format(YCMDstr, sizeof(YCMDstr), "Âû ñîçäàëè äîì. Íîìåð äîìà: %i",HouseInfo[TotalHouse][hID]); SendClientMessage(playerid, -1, YCMDstr); format(YCMDstr, sizeof(YCMDstr), "Èñïîëüçóéòå /sethousecarpos (Óêàçàòü ïîçèöèþ àâòî)"); SendClientMessage(playerid, -1, YCMDstr); BuyHouse(TotalHouse); return true; }
Сохранение:
Код format(HouseInfo[i][hSafes],50,"%i, %i, %i, %i, %i ,%i, %i, %i, %i, %i, %i", HouseInfo[i][hSafe][0], HouseInfo[i][hSafe][1], HouseInfo[i][hSafe][2], HouseInfo[i][hSafe][3], HouseInfo[i][hSafe][4], HouseInfo[i][hSafe][5], HouseInfo[i][hSafe][6], HouseInfo[i][hSafe][7], HouseInfo[i][hSafe][8], HouseInfo[i][hSafe][9], HouseInfo[i][hSafe][10]); mysql_format(DATABASE, QUERY, sizeof(QUERY), "UPDATE `"TABLE_HOUSE"` SET "); format(temp,sizeof(temp),"`hEntrancex`= '%f',",HouseInfo[i][hEntrancex]), strcat(QUERY,temp,sizeof(QUERY)); format(temp,sizeof(temp),"`hEntrancey`= '%f',",HouseInfo[i][hEntrancey]), strcat(QUERY,temp,sizeof(QUERY)); format(temp,sizeof(temp),"`hEntrancez`= '%f',",HouseInfo[i][hEntrancez]), strcat(QUERY,temp,sizeof(QUERY)); format(temp,sizeof(temp),"`hExitx`= '%f',",HouseInfo[i][hExitx]), strcat(QUERY,temp,sizeof(QUERY)); format(temp,sizeof(temp),"`hExity`= '%f',",HouseInfo[i][hExity]), strcat(QUERY,temp,sizeof(QUERY)); format(temp,sizeof(temp),"`hExitz`= '%f',",HouseInfo[i][hExitz]), strcat(QUERY,temp,sizeof(QUERY)); format(temp,sizeof(temp),"`hOwner`= '%s',",HouseInfo[i][hOwner]), strcat(QUERY,temp,sizeof(QUERY)); format(temp,sizeof(temp),"`Gosti_1`= '%s',",HouseInfo[i][Gosti_1]), strcat(QUERY,temp,sizeof(QUERY)); format(temp,sizeof(temp),"`Gosti_2`= '%s',",HouseInfo[i][Gosti_2]), strcat(QUERY,temp,sizeof(QUERY)); format(temp,sizeof(temp),"`Gosti_3`= '%s',",HouseInfo[i][Gosti_3]), strcat(QUERY,temp,sizeof(QUERY)); format(temp,sizeof(temp),"`Gosti_4`= '%s',",HouseInfo[i][Gosti_4]), strcat(QUERY,temp,sizeof(QUERY)); format(temp,sizeof(temp),"`Gosti_5`= '%s',",HouseInfo[i][Gosti_5]), strcat(QUERY,temp,sizeof(QUERY)); format(temp,sizeof(temp),"`hValue`= '%i',",HouseInfo[i][hValue]), strcat(QUERY,temp,sizeof(QUERY)); format(temp,sizeof(temp),"`hTakings`= '%i',",HouseInfo[i][hTakings]), strcat(QUERY,temp,sizeof(QUERY)); format(temp,sizeof(temp),"`hHel`= '%i',",HouseInfo[i][hHel]), strcat(QUERY,temp,sizeof(QUERY)); format(temp,sizeof(temp),"`hInt`= '%i',",HouseInfo[i][hInt]), strcat(QUERY,temp,sizeof(QUERY)); format(temp,sizeof(temp),"`hGarage`= '%i',",HouseInfo[i][hGarage]), strcat(QUERY,temp,sizeof(QUERY)); format(temp,sizeof(temp),"`hLock`= '%i',",HouseInfo[i][hLock]), strcat(QUERY,temp,sizeof(QUERY)); format(temp,sizeof(temp),"`hKlass`= '%i',",HouseInfo[i][hKlass]), strcat(QUERY,temp,sizeof(QUERY)); format(temp,sizeof(temp),"`hCarx`= '%f',",HouseInfo[i][hCarx]), strcat(QUERY,temp,sizeof(QUERY)); format(temp,sizeof(temp),"`hCary`= '%f',",HouseInfo[i][hCary]), strcat(QUERY,temp,sizeof(QUERY)); format(temp,sizeof(temp),"`hCarz`= '%f',",HouseInfo[i][hCarz]), strcat(QUERY,temp,sizeof(QUERY)); format(temp,sizeof(temp),"`hCarc`= '%f',",HouseInfo[i][hCarc]), strcat(QUERY,temp,sizeof(QUERY)); format(temp,sizeof(temp),"`hSafes`= '%s'",HouseInfo[i][hSafes]), strcat(QUERY,temp,sizeof(QUERY)); format(temp,sizeof(temp)," WHERE hID = '%i'",HouseInfo[i][hID]), strcat(QUERY,temp,sizeof(QUERY)); mysql_function_query(DATABASE, QUERY, true, "", "");
|
|
|
|