Hay community also ich habe einen Haus problem habe den gamemod von wos 4.0 -.- aber wenn ich /createhouse mache
erstellt sich haus und mann kann es kaufen und man kann rein aber man spamt nicht im haus wenn ich
/spawnchange mache steht da du hast kein haus/miete ich verstehe das nicht
kann mir jemand mal weiter helfen bitte
ps: keine dumme wörter lern scripten oder sonst was bitte danke!
#define MAX_HOUSES 500#define COLOR_HOUSELABEL 0xF6B400F6//Farbe der Scrift was auf den haus icon stehtenum hInfo{ hOwned, hOwner[MAX_PLAYER_NAME], hDescr[50], Float:hEntrx, Float:hEntry, Float:hEntrz, Float:hIntx, Float:hInty, Float:hIntz, hInt, hRentable, hPrice, hRent, Text3D:hLabel, hPick, hIntid, hLocked, hKasse}new HouseInfo[MAX_HOUSES][hInfo];
enum int_enum{ Float:intpx, Float:intpy, Float:intpz, interiorid, description[50]}new Interiors[][int_enum] = {{235.508994 ,1189.169897 ,1080.339966, 3, "Groß, 2 Stock"},{225.756989 ,1240.000000 ,1082.149902, 2, "Mittelgroß, 1 Stock"},{223.043991 ,1289.259888 ,1082.199951, 1, "Klein, 1 Stock"},{225.630997 ,1022.479980 ,1084.069946, 7, "Villa"},{295.138977 ,1474.469971 ,1080.519897, 15, "Klein, 1 Stock"},{328.493988 ,1480.589966 ,1084.449951, 15, "Klein, 1 Stock"},{344.3000,305.2000,999.1484,6,"Domina Hütte"},{386.9591,1471.6937,1080.1949,15,"Mittel, 1 Stock"},{234.3189,1063.7469,1084.2123,6,"Sehr Groß! 2 Stock"},{23.5581,1340.3097,1084.3750,10,"Groß, Stock"},{385.803986 ,1471.769897 ,1080.209961, 15, "Klein, 1 Stock"}};stock Float:GetX(i){ new Float:xasdf, Float:yasdf, Float:zasdf; GetPlayerPos(i, xasdf, yasdf, zasdf); return Float:xasdf;}
stock Float:GetY(i){ new Float:xasdf, Float:yasdf, Float:zasdf; GetPlayerPos(i, xasdf, yasdf, zasdf); return yasdf;}
stock Float:GetZ(i){ new Float:xasdf, Float:yasdf, Float:zasdf; GetPlayerPos(i, xasdf, yasdf, zasdf); return zasdf;}
stock Float:GetA(i){ new Float:xasdf; GetPlayerFacingAngle(i, xasdf); return xasdf;}stock GetVehicleSpeed(vehicleid, &Float:Speed){ new Float:X,Float:Y,Float:Z; GetVehicleVelocity(vehicleid, X, Y, Z); Speed = floatsqroot(X*X + Y*Y + Z*Z)*200;}stock IsAutoAn(vid){ new engine,lights,alarm,doors,bonnet,boot,objective; GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective); if(engine == VEHICLE_PARAMS_ON) return 1; return 0;
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; } GetPlayerName(playerid,sendername,sizeof(sendername)); 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(cmdtext, "/hauskasse", true)) { for(new i = 0; i<MAX_HOUSES; i++) { format(str, sizeof str, "/Houses/%d.ini", i); if(fexist(str)) { if(IsPlayerInRangeOfPoint(playerid, 10.0, HouseInfo[i][hIntx], HouseInfo[i][hInty], HouseInfo[i][hIntz]) && GetPlayerVirtualWorld(playerid) == i) { if(!strcmp(pn(playerid), HouseInfo[i][hOwner], false)) { ShowPlayerDialog(playerid, HauskasseDiag, 2, "Hauskasse", "Inhalt\nRausholen\nReintun", "Auswählen", "Beenden"); SetPVarInt(playerid, "Hauskassehid", i); } } } } return 1; } if(!strcmp(cmdtext, "/asellhouse", true)) { if(PlayerInfo[playerid][pAdmin] >= 4) { for(new i = 0; i<MAX_HOUSES; i++) { if(IsPlayerInRangeOfPoint(playerid, 5.0, HouseInfo[i][hEntrx], HouseInfo[i][hEntry], HouseInfo[i][hEntrz])) { HouseInfo[i][hOwned] = 0; new id = ReturnUser(HouseInfo[i][hOwner]); if(IsPlayerConnected(id)) { PlayerInfo[id][pHouseKey] = MAX_HOUSES+1; format(str, sizeof str, "Admin %s hat dein Haus verkauft!", pn(playerid)); SendClientMessage(id, Grey, str); } else { format(str, sizeof str, "/Accounts/%s.acc", HouseInfo[i][hOwner]); if(INI_Open(str)) { INI_WriteInt("HouseKey", MAX_HOUSES+1); INI_Save(); INI_Close(); } } 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, "Haus verkauft und HouseKey des Besitzers zurückgesetzt!"); UpdateHouseLabel(i); SaveHouses(); return 1; } } } else SendClientMessage(playerid, Grey, "Du bist kein Admin oder nicht im Adminmode!"); return 1; } if(!strcmp(cmdtext, "/mietstatus", true)) { new i = PlayerInfo[playerid][pHouseKey]; if(i == MAX_HOUSES+1) return SendClientMessage(playerid, Grey, "Du besitzt kein Haus!"); if(!HouseInfo[i][hRentable]) { HouseInfo[i][hRentable] = 1; UpdateHouseLabel(i); SendClientMessage(playerid, Grey, "Andere Spieler können sich nun dein Haus mieten!"); return 1; } if(HouseInfo[i][hRentable]) { HouseInfo[i][hRentable] = 0; UpdateHouseLabel(i); SendClientMessage(playerid, Grey, "Andere Spieler können sich dein Haus nun nicht mehr mieten!"); return 1; } return 1; } if(!strcmp(cmd, "/miete", true)) { new i = PlayerInfo[playerid][pHouseKey]; if(i == MAX_HOUSES+1) return SendClientMessage(playerid, Grey, "Du besitzt kein Haus!"); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) return SendClientMessage(playerid, Grey, "Verwendung: /Miete [1-10000]"); new miete = strval(tmp); if(miete < 1 || miete > 10000) return SendClientMessage(playerid, Grey, "Gib einen Betrag zwischen 1 und 10000 an!"); HouseInfo[i][hRent] = miete; format(str, sizeof str, "Deine neue Miete beträgt %d€", miete); SendClientMessage(playerid, Grey, str); UpdateHouseLabel(i); return 1; } if(!strcmp(cmd, "/rausschmeissen", true)) { new i = PlayerInfo[playerid][pHouseKey]; if(i == MAX_HOUSES+1) return SendClientMessage(playerid, Grey, "Du besitzt kein Haus!"); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) return SendClientMessage(playerid, Grey, "Verwendung: /Rausschmeissen [PlayerID/Name] ( Wenn der Spieler nicht online ist, gib den genauen Namen an! )"); new pid = ReturnUser(tmp); if(pid == INVALID_PLAYER_ID && !IsPlayerConnected(pid)) { new path[50], rentkey; format(path, sizeof path, "/Accounts/%s.acc", tmp); if(!fexist(path)) return SendClientMessage(playerid, Grey, "Dieser Spieler ist nicht online und der Account existiert nicht!"); if(INI_Open(path)) { rentkey = INI_ReadInt("RentHouseKey"); if(rentkey != i) return SendClientMessage(playerid, Grey, "Der Spieler mietet sich dein Haus nicht!"); INI_WriteInt("RentHouseKey", MAX_HOUSES+1); INI_Save(); INI_Close(); } return 1; } else if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pRentHouseKey] != i) return SendClientMessage(playerid, Grey, "Der Spieler mietet sich dein Haus nicht!"); PlayerInfo[pid][pRentHouseKey] = MAX_HOUSES+1; format(string, sizeof string, "Du hast %s aus dem Haus geschmissen!", pn(pid)); SendClientMessage(playerid, Grey, str); format(string, sizeof string, "Du wurdest von %s aus dem Haus geschmissen!", pn(playerid));SendClientMessage(pid, Grey, str); return 1; } return 1; } if(!strcmp(cmdtext, "/allerausschmeissen", true)) { new i = PlayerInfo[playerid][pHouseKey]; if(i == MAX_HOUSES+1) return SendClientMessage(playerid, Grey, "Du besitzt kein Haus!"); for(new p = 0; p<GetMaxPlayers(); p++) { if(IsPlayerConnected(p)) { if(PlayerInfo[p][pRentHouseKey] == i) { PlayerInfo[p][pRentHouseKey] = MAX_HOUSES+1; SendClientMessage(p, Grey, "Dein Vermieter hat dich aus der Wohnung geschmissen!"); } } } SendClientMessage(playerid, Grey, "Alle Bewohner wurden aus der Wohnung geschmissen!"); return 1; } 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(cmdtext, "/interiors", true)) { if(PlayerInfo[playerid][pAdmin] >= 5) { for(new i = 0; i<sizeof(Interiors); i++) { format(str, sizeof str, "Interior Typ %d: %s, IntID: %d", i+1, Interiors[i][description]); SendClientMessage(playerid, Grey, str); } return 1; } return 1; } if(!strcmp(cmd, "/createhouse", true)) { if(PlayerInfo[playerid][pAdmin] >= 7) { 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(str, sizeof str, "/Houses/%d.ini", i); dini_Create(str); 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(str, sizeof str, "%s\nZum Verkauf\nPreis: %d€", HouseInfo[i][hDescr], HouseInfo[i][hPrice]); HouseInfo[i][hLabel] = CreateDynamic3DTextLabel(str, 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, "/destroyhouse", true)) { if(PlayerInfo[playerid][pAdmin] >= 7) { for(new i = 0; i<MAX_HOUSES; i++) { if(IsPlayerInRangeOfPoint(playerid, 5.0, HouseInfo[i][hEntrx], HouseInfo[i][hEntry], HouseInfo[i][hEntrz])) { DestroyDynamicPickup(HouseInfo[i][hPick]); DestroyDynamic3DTextLabel(HouseInfo[i][hLabel]); format(string, sizeof string, "/Houses/%d.ini", i); fremove(string); HouseInfo[i][hEntrx] = 0; HouseInfo[i][hEntry] = 0; HouseInfo[i][hEntrz] = 0; HouseInfo[i][hIntx] = 0; HouseInfo[i][hInty] = 0; HouseInfo[i][hIntz] = 0; HouseInfo[i][hOwned] = 0; format(HouseInfo[i][hOwner], MAX_PLAYER_NAME, "-"); HouseInfo[i][hPrice] = 0; HouseInfo[i][hIntid] = 0; HouseInfo[i][hInt] = 0; HouseInfo[i][hRentable] = 0; HouseInfo[i][hRent] = 0; HouseInfo[i][hLocked] = 0; format(HouseInfo[i][hDescr], 50, "-"); SendClientMessage(playerid, Grey, "Haus gelöscht!"); } } } return 1; } if(!strcmp(cmd, "/houseid", true)) { if(PlayerInfo[playerid][pAdmin] >= 4) { for(new i = 0; i<MAX_HOUSES; i++) { if(IsPlayerInRangeOfPoint(playerid, 5.0, HouseInfo[i][hEntrx], HouseInfo[i][hEntry], HouseInfo[i][hEntrz])) {
format(string, sizeof string, "HouseID: %d", i); SendClientMessage(playerid, Grey, string); return 1; } } } return 1; } if(!strcmp(cmd, "/sethouseprice", true)) { if(PlayerInfo[playerid][pAdmin] >= 4) { for(new i = 0; i<MAX_HOUSES; i++) { if(IsPlayerInRangeOfPoint(playerid, 5.0, HouseInfo[i][hEntrx], HouseInfo[i][hEntry], HouseInfo[i][hEntrz])) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) return SendClientMessage(playerid, Grey, "Verwendung: /SetHousePrice [Preis]"); new price = strval(tmp); if( price < 0) return SendClientMessage(playerid, Grey, "Ungültiger Preis!"); HouseInfo[i][hPrice] = price; UpdateHouseLabel(i); return 1; } } } return 1; } if(!strcmp(cmdtext, "/hausaufzu", true)) { for(new i = 0; i<MAX_HOUSES; i++) { if(IsPlayerInRangeOfPoint(playerid, 5.0, HouseInfo[i][hEntrx], HouseInfo[i][hEntry], HouseInfo[i][hEntrz])) { if(PlayerInfo[playerid][pHouseKey] == i) { if(HouseInfo[i][hLocked]) { HouseInfo[i][hLocked] = 0; SendClientMessage(playerid, Grey, "Haus aufgeschlossen!"); return 1; } else if(!HouseInfo[i][hLocked]) { HouseInfo[i][hLocked] = 1; SendClientMessage(playerid, Grey, "Haus abgeschlossen!"); return 1; } } else { SendClientMessage(playerid, Grey, "Dieses Haus gehört dir nicht!"); return 1; } } } return 1; } if(!strcmp(cmdtext, "/ahausaufzu", true)) { if(PlayerInfo[playerid][pAdmin] >= 3) { 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][hLocked]) { HouseInfo[i][hLocked] = 0; SendClientMessage(playerid, Grey, "Haus aufgeschlossen!"); return 1; } else if(!HouseInfo[i][hLocked]) { HouseInfo[i][hLocked] = 1; SendClientMessage(playerid, Grey, "Haus abgeschlossen!"); return 1; } return 1; } } } return 1; } if(!strcmp(cmdtext, "/haushilfe", true)) { if(PlayerInfo[playerid][pAdmin] > 0) { SendClientMessage(playerid, Grey, "/CreateHouse [Preis] [Interior Typ], /interiors, /asellhouse, /gotohouse [HouseID], /enterhouse [HouseID], /SetHousePrice [Preis], /HouseID /hauskasse"); SendClientMessage(playerid, Grey, "/HausVerkaufen,sethouseprice, /HausKaufen, /Miete, /Mieten, /WohnungKündigen, /HausAufZu, /Mietstatus, /Rausschmeissen [PlayerID/Name], /AlleRausschmeissen"); SendClientMessage(playerid, Grey, "/HausVerkaufen, /HausKaufen, /Miete, /Mieten, /WohnungKündigen, /HausAufZu, /Mietstatus, /Rausschmeissen [PlayerID/Name], /AlleRausschmeissen"); } else if(PlayerInfo[playerid][pAdmin] == 0) { SendClientMessage(playerid, Grey, "/HausVerkaufen, /HausKaufen, /Miete, /Mieten, /WohnungKündigen, /HausAufZu, /Mietstatus, /Rausschmeissen [PlayerID/Name], /AlleRausschmeissen"); } return 1; } if(!strcmp(cmd, "/enterhouse", true)) { if(PlayerInfo[playerid][pAdmin] >= 3) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) return SendClientMessage(playerid, Grey, "Verwendung: /EnterHouse [HouseID]"); new i = strval(tmp); if(i < 0 || i > MAX_HOUSES) return SendClientMessage(playerid, Grey, "Ungültige Haus ID!"); SetPlayerPos(playerid, HouseInfo[i][hIntx], HouseInfo[i][hInty], HouseInfo[i][hIntz]); SetPlayerInterior(playerid, HouseInfo[i][hInt]); SetPlayerVirtualWorld(playerid, i); } return 1; } if(!strcmp(cmd, "/sethausint", true)) { if(PlayerInfo[playerid][pAdmin] >= 5) { for(new i = 0; i<MAX_HOUSES; i++) { if(IsPlayerInRangeOfPoint(playerid, 5.0, HouseInfo[i][hEntrx], HouseInfo[i][hEntry], HouseInfo[i][hEntrz])) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) return SendClientMessage(playerid, Grey, "Verwendung: /SethausInt [ID] ( /interiors )"); new intid = strval(tmp); if(intid < 1 || intid > 11) return SendClientMessage(playerid, Grey, "Ungültige Interior ID. /interiors"); HouseInfo[i][hIntid] = intid; DestroyDynamicPickup(HouseInfo[i][hPick]); DestroyDynamic3DTextLabel(HouseInfo[i][hLabel]); SaveHouse(i); LoadHouse(i); SendClientMessage(playerid, Grey, "Interior ID geändert!"); return 1; } } } return 1; } if(!strcmp(cmdtext, "/wohnungkündigen", true)) { if(PlayerInfo[playerid][pRentHouseKey] == MAX_HOUSES+1) return SendClientMessage(playerid, Grey, "Du mietest keine Wohnung!"); PlayerInfo[playerid][pRentHouseKey] = MAX_HOUSES+1; SendClientMessage(playerid, Grey, "Mietvertrag gekündigt!"); return 1; } if(!strcmp(cmdtext, "/mieten", 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]) return SendClientMessage(playerid, Grey, "Dieses Haus gehört niemandem!"); if(HouseInfo[i][hRentable] == 0) return SendClientMessage(playerid, Grey, "Der Besitzer vermietet das Haus nicht!"); if(PlayerInfo[playerid][pHouseKey] != MAX_HOUSES+1) return SendClientMessage(playerid, Grey, "Du kannst dir kein Haus mieten, wenn du bereits eines besitzt!"); if(PlayerInfo[playerid][pRentHouseKey] != MAX_HOUSES+1) return SendClientMessage(playerid, Grey, "Du mietest dir bereits ein Haus!"); PlayerInfo[playerid][pRentHouseKey] = i; format(str, sizeof str, "Du mietest dieses Haus jetzt! An jedem Payday werden dir ab sofort die Mietkosten in Höhe von %d€ abgezogen!", HouseInfo[i][hRent]); SendClientMessage(playerid, Grey, str); SendClientMessage(playerid, Grey, "Tippe /wohungkündigen um vom Mietvertrag zurückzutreten!"); } } 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; }