Ich habe mich auch schon überall durchgeschaut .. finde nichts -.-
if(!strcmp(cmdtext, "/hauskaufen", true))
{
for(new i = 0; i<MAX_HOUSES; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, HouseInfo[i][hEntrx], HouseInfo[i][hEntry], HouseInfo[i][hEntrz]))
{
if(!HouseInfo[i][hOwned])
{
if(GetPlayerMoney(playerid) < HouseInfo[i][hPrice])
{
SendClientMessage(playerid, Grey, "Du hast nicht genug Geld!");
return 1;
}
if(PlayerInfo[playerid][pHouseKey] != MAX_HOUSES+1)
{
SendClientMessage(playerid, Grey, "Du besitzt bereits ein Haus!");
return 1;
}
format(HouseInfo[i][hOwner], 24, sendername);
HouseInfo[i][hOwned] = 1;
UpdateHouseLabel(i);
PlayerInfo[playerid][pHouseKey] = i;
GivePlayerMoney(playerid, -HouseInfo[i][hPrice]);
SendClientMessage(playerid, Grey, "Glückwunsch zum Kauf der Immobilie!");
SaveHouses();
return 1;
}
}
}
return 1;
}
if(!strcmp(cmd, "/createhouse", true))
{
if(PlayerInfo[playerid][pAdmin] == 1339)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, Grey, "/CreateHouse [Preis] [Interior Typ ( /interiors )]");
new housepreis = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, Grey, "/CreateHouse [Preis] [Interior Typ ( /interiors )]");
new inttype = strval(tmp);
if(inttype < 1 || inttype > sizeof(Interiors)) return SendClientMessage(playerid, Grey, "Ungültige Interior Typ ID! /interiors");
inttype -= 1;
new i = GetHouseID(); if(i == -1) return SendClientMessage(playerid, Grey, "Es kann kein weiters Haus mehr erstellt werden! ( MAX_HOUSES erhöhen )");
format(string, sizeof string, "/Houses/%d.ini", i);
dini_Create(string);
HouseInfo[i][hEntrx] = GetX(playerid);
HouseInfo[i][hEntry] = GetY(playerid);
HouseInfo[i][hEntrz] = GetZ(playerid);
HouseInfo[i][hInt] = Interiors[inttype][interiorid];
HouseInfo[i][hIntx] = Interiors[inttype][intpx];
HouseInfo[i][hInty] = Interiors[inttype][intpy];
HouseInfo[i][hIntz] = Interiors[inttype][intpz];
HouseInfo[i][hIntid] = inttype;
HouseInfo[i][hPrice] = housepreis;
HouseInfo[i][hRentable] = 0;
HouseInfo[i][hRent] = 50;
HouseInfo[i][hOwned] = 0;
format(HouseInfo[i][hOwner], MAX_PLAYER_NAME, "-");
format(HouseInfo[i][hDescr], 50, "%s", Interiors[inttype][description]);
format(string, sizeof string, "%s\nZum Verkauf\nPreis: %d€", HouseInfo[i][hDescr], HouseInfo[i][hPrice]);
HouseInfo[i][hLabel] = CreateDynamic3DTextLabel(string, COLOR_HOUSELABEL, HouseInfo[i][hEntrx], HouseInfo[i][hEntry], HouseInfo[i][hEntrz], 20);
HouseInfo[i][hPick] = CreateDynamicPickup(1273, 1, HouseInfo[i][hEntrx], HouseInfo[i][hEntry], HouseInfo[i][hEntrz]);
SendClientMessage(playerid, Grey, "Haus erstellt!");
SaveHouse(i);
return 1;
}
return 1;
}
if(!strcmp(cmdtext, "/hausverkaufen", true))
{
new i = PlayerInfo[playerid][pHouseKey]; if(i == MAX_HOUSES+1) return SendClientMessage(playerid, Grey, "Du besitzt kein Haus!");
GivePlayerMoney(playerid, HouseInfo[i][hPrice]/4);
HouseInfo[i][hOwned] = 0;
format(HouseInfo[i][hOwner], MAX_PLAYER_NAME, "-");
DestroyDynamicPickup(HouseInfo[i][hPick]);
HouseInfo[i][hPick] = CreateDynamicPickup(1273, 1, HouseInfo[i][hEntrx], HouseInfo[i][hEntry], HouseInfo[i][hEntrz]);
SendClientMessage(playerid, Grey, "Du hast dein Haus verkauft und erhälst 1/4 des Kaufpreises zurück!");
UpdateHouseLabel(i);
PlayerInfo[playerid][pHouseKey] = MAX_HOUSES+1;
SaveHouses();
return 1;
}