Hallo,
Habe ein Dynamisches Haus System, womit ich InGame Häuser erstellen kann.
Das Problem ist aber das ich mich mit Dini nicht auskenne,
und bei einem Server Restart sind die Häuser weg.
Wie mache ich das die Häuser speichern?
Code
if(strcmp(cmd, "/createhouse", true) == 0)
{
if (PlayerInfo[playerid][pAdmin] >= 5)
{
for(new i = 0; i < sizeof(HouseInfo); i++)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
HouseInfo[hEntrancex] = x;
HouseInfo[hEntrancey] = y;
HouseInfo[hEntrancez] = z;
HouseInfo[hExitx] = 446.1000;
HouseInfo[hExity] = 507.9000;
HouseInfo[hExitz] = 1001.4195;
HouseInfo[hHealthx] = 0;
HouseInfo[hHealthy] = 0;
HouseInfo[hHealthz] = 0;
HouseInfo[hArmourx] = 0;
HouseInfo[hArmoury] = 0;
HouseInfo[hArmourz] = 0;
HouseInfo[hOwner] = 0;
//new test[128];
//format(test,sizeof(test),"ID %d", i);
HouseInfo[hDiscription] = 0;
HouseInfo[hValue] = 7000;
HouseInfo[hHel] = 0;
HouseInfo[hArm] = 0;
HouseInfo[hInt] = 12;
HouseInfo[hLock] = 1;
HouseInfo[hOwned] = 0;
HouseInfo[hRooms] = 1;
HouseInfo[hRent] = 1;
HouseInfo[hRentabil] = 1;
HouseInfo[hTakings] = 0;
HouseInfo[hVec] = 0;
HouseInfo[hVcol1] = -1;
HouseInfo[hVcol2] = -1;
HouseInfo[hDate] = 0;
HouseInfo[hLevel] = 5;
strmid(HouseInfo[hOwner], "The State", 0, strlen("The State"), 255);
SendClientMessage(playerid, COLOR_OOC,"Du hast ein Neues Haus erstellt");
SendClientMessage(playerid, COLOR_WHITE, "Mit /edit kannst du das Haus Editieren!");
new string2[128];
new File: file2;
file2 = fopen("property.cfg", io_append);
new string3[450];
format(string3,sizeof(string3),"%f,%f,%f,%f,%f,%f,%d,%d,%d,%d,%d,%d,%s,%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",
HouseInfo[hEntrancex],HouseInfo[hEntrancey],HouseInfo[hEntrancez],HouseInfo[hExitx],HouseInfo[hExity],
HouseInfo[hExitz],HouseInfo[hHealthx],HouseInfo[hHealthy],HouseInfo[hHealthz],HouseInfo[hArmourx],
HouseInfo[hArmoury],HouseInfo[hArmourz],HouseInfo[hOwner],HouseInfo[hDiscription],HouseInfo[hValue],
HouseInfo[hHel],HouseInfo[hArm],HouseInfo[hInt],HouseInfo[hLock],HouseInfo[hOwned],HouseInfo[hRooms],
HouseInfo[hRent],HouseInfo[hRentabil],HouseInfo[hTakings],HouseInfo[hVec],HouseInfo[hVcol1],HouseInfo[hVcol2],
HouseInfo[hDate],HouseInfo[hLevel]);
fwrite(file2, string3);
fclose(file2);
format(string2, sizeof(string2), "[Haus zu verkaufen - %s]\nPreis: $%d\nLevel: %d\n/buyhouse zum kaufen",HouseInfo[hDiscription],HouseInfo[hValue],HouseInfo[hLevel]);
HouseInfo[Text] = Create3DTextLabel(string2,COLOR_FORSELL,HouseInfo[hEntrancex], HouseInfo[hEntrancey], HouseInfo[hEntrancez]+1,15.0,0);
AddStaticPickup(1273, 1, HouseInfo[hEntrancex], HouseInfo[hEntrancey], HouseInfo[hEntrancez], 0);
pickups++;
OnPropUpdate();
return 1;
}
}
return 1;
}
Alles anzeigen
[i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i]