Hi,
Könnte so vll gehen musst du ausprobieren.
dcmd_createhouse(playerid, params[])
{
new preis, string[255], interior;
if(IsPlayerAdmin(playerid,5))
{
format(string,255,"Bitte benutze /Createhouse [Geld] [HausID].");
if(sscanf(params,"dd",preis,interior))return SendClientMessage(playerid,FARBE,string);
if(interior <= sizeof hEnter - 1 )
{
new Float:pX, Float:pY, Float:pZ;
GetPlayerPos(playerid, pX, pY, pZ);
new first = -1;
for (new i=1;i<=MAX_HOUSE;i++) {
format(file,sizeof file, "House/House%d.cfg", i);
if(!dini_Exists(file) && first == -1 )
{
first = i;
}
}
format(file,sizeof file, "House/House%d.cfg", first);
format(string,255,"Staat");
dini_Create(file);
dini_Set(file, "Owner", string);
dini_IntSet(file, "Preis", preis);
dini_IntSet(file, "Int", interior);
dini_IntSet(file, "Locked", 1);
dini_IntSet(file, "VW", lastVirtualWorld + 1);
dini_FloatSet(file, "hX", pX);
dini_FloatSet(file, "hY", pY);
dini_FloatSet(file, "hZ", pZ);
hInfo[first][hOwner] = string;
hInfo[first][hPreis] = preis;
hInfo[first][hEnterID] = interior;
hInfo[first][hVirtualWorld] = lastVirtualWorld + 1;
hInfo[first][hX] = pX,hInfo[first][hY] = pY,hInfo[first][hZ] = pZ;
loadHouse(first);
lastVirtualWorld ++;
}
else SendClientMessage(playerid,FARBE,"Falsche Interior Zahl.");
}
}
return SendClientMessage(playerid, error, "Du bist kein Admin.");
}
PS: Musst halt richtig einreihen.
MFG