ocmd:hcreate(playerid,params[])
{
if(!IsPlayerAnAdmin(playerid))return SendClientMessage(playerid,Rot,"Error: {FFFFFF}You are not allowed to use this Command.");
if(!IsPlayerAdminRank(playerid,4))return SendClientMessage(playerid,Rot,"Error: {FFFFFF}You are not allowed to use this Command.");
new inter,price;
if(sscanf(params,"ii",inter,price))return SendClientMessage(playerid,Rot,"Error: {FFFFFF}Use /hcreate [Interior ID] [BuyPrice]"),
SendClientMessage(playerid,Grau,"[Types]: 1: Apartment, 2: House, 3: Villa");
if(!InteriorInfo[inter][int_ID])return SendClientMessage(playerid,Rot,"Error: {FFFFFF}This isn't a Valid Interior. Use /validint to see what Interiors are Valid.");
for(new i=0;i<MAX_HOUSES;i++)
{
if(strlen(HouseInfo[i][h_owner]))continue;
{
new query[512];
new Float:pos[3];
GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
HouseInfo[i][h_enterX] = pos[0];
HouseInfo[i][h_enterY] = pos[1];
HouseInfo[i][h_enterZ] = pos[2];
HouseInfo[i][h_exitX] = InteriorInfo[i][int_exitX];
HouseInfo[i][h_exitY] = InteriorInfo[i][int_exitY];
HouseInfo[i][h_exitZ] = InteriorInfo[i][int_exitZ];
HouseInfo[i][h_int] = inter;
format(HouseInfo[i][h_owner], 24, "Niemand");
format(query,sizeof(query),"INSERT INTO Houses (id,Owner,EnterPosX,EnterPosY,EnterPosZ,ExitPosX,ExitPosY,ExitPosZ,Interior) VALUES ('%i','%s','%f','%f','%f','%f','%f','%f','%i')",
i,HouseInfo[i][h_owner],HouseInfo[i][h_enterX],HouseInfo[i][h_enterY],HouseInfo[i][h_enterZ],HouseInfo[i][h_exitX],HouseInfo[i][h_exitY],HouseInfo[i][h_exitZ],HouseInfo[i][h_int]);
mysql_pquery(Handle,query);
HouseInfo[i][h_vw] = cache_get_field_content_int(i,"VirtualWorld");
HouseInfo[i][h_buyprice] = price;
HouseInfo[i][h_rentprice] = 100;
HouseInfo[i][h_bought] = 0;
HouseInfo[i][h_rentable] = 0;
HouseInfo[i][h_locked] = 1;
HouseInfo[i][h_money] = 0;
HouseInfo[i][h_type] = InteriorInfo[i][int_type];
format(query,sizeof(query),"UPDATE Houses SET BuyPrice='%i',RentPrice='%i',Bought='%i',`Locked`='%i',Money='%i',`Type`='%i',RentAble='%i' WHERE id='%i'",
HouseInfo[i][h_buyprice],HouseInfo[i][h_rentprice],HouseInfo[i][h_bought],HouseInfo[i][h_locked],HouseInfo[i][h_money],HouseInfo[i][h_type],HouseInfo[i][h_rentable],i);
if(HouseInfo[i][h_type] == 0)
{
new str[128];
format(str,sizeof(str),"This Apartment has NO Owner, you can buy it.\nPrice: %i$",HouseInfo[i][h_buyprice]);
Create3DTextLabel(str,Weiß,HouseInfo[i][h_enterX],HouseInfo[i][h_enterY],HouseInfo[i][h_enterZ],10,0,0);
CreatePickup(1274,0,HouseInfo[i][h_enterX],HouseInfo[i][h_enterY],HouseInfo[i][h_enterZ],0);
}
else if(HouseInfo[i][h_type] == 1)
{
new str[128];
format(str,sizeof(str),"This House has NO Owner, you can buy it.\nPrice: %i$",HouseInfo[i][h_buyprice]);
Create3DTextLabel(str,Weiß,HouseInfo[i][h_enterX],HouseInfo[i][h_enterY],HouseInfo[i][h_enterZ],10,0,0);
CreatePickup(1274,0,HouseInfo[i][h_enterX],HouseInfo[i][h_enterY],HouseInfo[i][h_enterZ],0);
}
else if(HouseInfo[i][h_type] == 2)
{
new str[128];
format(str,sizeof(str),"This Villa has NO Owner, you can buy it.\nPrice: %i$",HouseInfo[i][h_buyprice]);
Create3DTextLabel(str,Weiß,HouseInfo[i][h_enterX],HouseInfo[i][h_enterY],HouseInfo[i][h_enterZ],10,0,0);
CreatePickup(1274,0,HouseInfo[i][h_enterX],HouseInfo[i][h_enterY],HouseInfo[i][h_enterZ],0);
}
return 1;
}
}
return 1;
}
Dann sollte es passen.