Hey,
Hab mir einen Befehl gemacht womit ich Ingame ein Haus erstellen kann.
Wenn ich dann ein Haus erstelle , erstellt der mind. 100 Häuser an dieser Position. (So das mein GTA laggt)
Weiß nicht woran das liegt.
Hier der Befehl:
if(strcmp(cmd, "/ehaus", 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[i][hEntrancex] = x;
HouseInfo[i][hEntrancey] = y;
HouseInfo[i][hEntrancez] = z;
HouseInfo[i][hExitx] = 244.5000;
HouseInfo[i][hExity] = 305.0000;
HouseInfo[i][hExitz] = 999.1484;
HouseInfo[i][hHealthx] = 0;
HouseInfo[i][hHealthy] = 0;
HouseInfo[i][hHealthz] = 0;
HouseInfo[i][hArmourx] = 0;
HouseInfo[i][hArmoury] = 0;
HouseInfo[i][hArmourz] = 0;
HouseInfo[i][hOwner] = 0;
HouseInfo[i][hDiscription] = 0;
HouseInfo[i][hValue] = 500;
HouseInfo[i][hHel] = 0;
HouseInfo[i][hArm] = 0;
HouseInfo[i][hInt] = 1;
HouseInfo[i][hLock] = 1;
HouseInfo[i][hOwned] = 0;
HouseInfo[i][hRooms] = 1;
HouseInfo[i][hRent] = 1;
HouseInfo[i][hRentabil] = 1;
HouseInfo[i][hTakings] = 0;
HouseInfo[i][hVec] = 0;
HouseInfo[i][hVcol1] = -1;
HouseInfo[i][hVcol2] = -1;
HouseInfo[i][hDate] = 0;
HouseInfo[i][hLevel] = 1;
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,%f,%f,%f,%f,%f,%f,%s,%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,",
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[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez],HouseInfo[i][hExitx],HouseInfo[i][hExity],
HouseInfo[i][hExitz],HouseInfo[i][hHealthx],HouseInfo[i][hHealthy],HouseInfo[i][hHealthz],HouseInfo[i][hArmourx],
HouseInfo[i][hArmoury],HouseInfo[i][hArmourz],HouseInfo[i][hOwner],HouseInfo[i][hDiscription],HouseInfo[i][hValue],
HouseInfo[i][hHel],HouseInfo[i][hArm],HouseInfo[i][hInt],HouseInfo[i][hLock],HouseInfo[i][hOwned],HouseInfo[i][hRooms],
HouseInfo[i][hRent],HouseInfo[i][hRentabil],HouseInfo[i][hTakings],HouseInfo[i][hVec],HouseInfo[i][hVcol1],HouseInfo[i][hVcol2],
HouseInfo[i][hDate],HouseInfo[i][hLevel]);
fwrite(file2, string3);
fclose(file2);
format(string2, sizeof(string2), "[Haus zu verkaufen - %s]\nPreis: $%d\nLevel: %d\n/buyhouse zum kaufen",HouseInfo[i][hDiscription],HouseInfo[i][hValue],HouseInfo[i][hLevel]);
HouseInfo[i][Text] = Create3DTextLabel(string2,COLOR_FORSELL,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]+1,15.0,0);
AddStaticPickup(1273, 1, HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez], 0);
pickups++;
}
}
return 1;
}
{
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[i][hEntrancex] = x;
HouseInfo[i][hEntrancey] = y;
HouseInfo[i][hEntrancez] = z;
HouseInfo[i][hExitx] = 244.5000;
HouseInfo[i][hExity] = 305.0000;
HouseInfo[i][hExitz] = 999.1484;
HouseInfo[i][hHealthx] = 0;
HouseInfo[i][hHealthy] = 0;
HouseInfo[i][hHealthz] = 0;
HouseInfo[i][hArmourx] = 0;
HouseInfo[i][hArmoury] = 0;
HouseInfo[i][hArmourz] = 0;
HouseInfo[i][hOwner] = 0;
HouseInfo[i][hDiscription] = 0;
HouseInfo[i][hValue] = 500;
HouseInfo[i][hHel] = 0;
HouseInfo[i][hArm] = 0;
HouseInfo[i][hInt] = 1;
HouseInfo[i][hLock] = 1;
HouseInfo[i][hOwned] = 0;
HouseInfo[i][hRooms] = 1;
HouseInfo[i][hRent] = 1;
HouseInfo[i][hRentabil] = 1;
HouseInfo[i][hTakings] = 0;
HouseInfo[i][hVec] = 0;
HouseInfo[i][hVcol1] = -1;
HouseInfo[i][hVcol2] = -1;
HouseInfo[i][hDate] = 0;
HouseInfo[i][hLevel] = 1;
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,%f,%f,%f,%f,%f,%f,%s,%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,",
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[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez],HouseInfo[i][hExitx],HouseInfo[i][hExity],
HouseInfo[i][hExitz],HouseInfo[i][hHealthx],HouseInfo[i][hHealthy],HouseInfo[i][hHealthz],HouseInfo[i][hArmourx],
HouseInfo[i][hArmoury],HouseInfo[i][hArmourz],HouseInfo[i][hOwner],HouseInfo[i][hDiscription],HouseInfo[i][hValue],
HouseInfo[i][hHel],HouseInfo[i][hArm],HouseInfo[i][hInt],HouseInfo[i][hLock],HouseInfo[i][hOwned],HouseInfo[i][hRooms],
HouseInfo[i][hRent],HouseInfo[i][hRentabil],HouseInfo[i][hTakings],HouseInfo[i][hVec],HouseInfo[i][hVcol1],HouseInfo[i][hVcol2],
HouseInfo[i][hDate],HouseInfo[i][hLevel]);
fwrite(file2, string3);
fclose(file2);
format(string2, sizeof(string2), "[Haus zu verkaufen - %s]\nPreis: $%d\nLevel: %d\n/buyhouse zum kaufen",HouseInfo[i][hDiscription],HouseInfo[i][hValue],HouseInfo[i][hLevel]);
HouseInfo[i][Text] = Create3DTextLabel(string2,COLOR_FORSELL,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]+1,15.0,0);
AddStaticPickup(1273, 1, HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez], 0);
pickups++;
}
}
return 1;
}
Hoffe ihr könnt mir Helfen.
-Trust