Hey Leutz,
Habe beim WoS Script 2 Fehler :
Tanksystem :
- /tanken hört nicht auf.
- Wenn ich ein Fahrzeug kaufe, sind nach ein Paar sekunden nicht mehr 100 sondern 45 L im tank!
Haussystem :
- Zeigt den Bestzer nicht an!
Code Tanken :
/tanken Befehl
if(strcmp(cmd, "/tanken", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,10,1004.0812,-939.4362,42.1797))
{
if(IsPlayerConnected(playerid))
{
if(IsAtGasStation(playerid))
{
if(IsANoTachoVehicle(GetPlayerVehicleID(playerid)))
{
SendClientMessage(playerid,COLOR_YELLOW," Du kannst kein Fahrrad betanken!");
}
SetTimer("Fillup",RefuelWait,0);
Refueling[playerid] = 1;
FreezePlayer(playerid);
SendClientMessage(playerid,COLOR_WHITE," Dein Fahrzeug wird betankt, Bitte warten....");
}
return 1;
}
}
}
#define RefuelWait 5000
#define SPRITPREIS 2
{
if(IsPlayerInRangeOfPoint(playerid,10,1004.0812,-939.4362,42.1797))
{
if(IsPlayerConnected(playerid))
{
if(IsAtGasStation(playerid))
{
if(IsANoTachoVehicle(GetPlayerVehicleID(playerid)))
{
SendClientMessage(playerid,COLOR_YELLOW," Du kannst kein Fahrrad betanken!");
}
SetTimer("Fillup",RefuelWait,0);
Refueling[playerid] = 1;
FreezePlayer(playerid);
SendClientMessage(playerid,COLOR_WHITE," Dein Fahrzeug wird betankt, Bitte warten....");
}
return 1;
}
}
}
#define RefuelWait 5000
#define SPRITPREIS 2
#define CAR_AMOUNT 700 //Change to Your Vehicle Amount
new Gas[CAR_AMOUNT];
new Gas[CAR_AMOUNT];
new Refueling[MAX_PLAYERS];
#define RefuelWait 5000
Code Haus :
//=========================================================[Haus System by K3VIN aka Rapture]=====================================================//
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;
}
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(string, sizeof string, "Admin %s hat dein Haus verkauft!", pn(playerid));
SendClientMessage(id, Grey, string);
}
else
{
format(string, sizeof string, "/Accounts/%s.txt", HouseInfo[i][hOwner]);
if(INI_Open(string))
{
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(string, sizeof string, "Deine neue Miete beträgt %d€", miete);
SendClientMessage(playerid, Grey, string);
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.txt", 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, string);
format(string, sizeof string, "Du wurdest von %s aus dem Haus geschmissen!", pn(playerid));SendClientMessage(pid, Grey, string);
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, "/destroyhouse", true))
{
if(PlayerInfo[playerid][pAdmin] == 1339)
{
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]))
{
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;
}
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(string, sizeof string, "Admin %s hat dein Haus verkauft!", pn(playerid));
SendClientMessage(id, Grey, string);
}
else
{
format(string, sizeof string, "/Accounts/%s.txt", HouseInfo[i][hOwner]);
if(INI_Open(string))
{
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(string, sizeof string, "Deine neue Miete beträgt %d€", miete);
SendClientMessage(playerid, Grey, string);
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.txt", 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, string);
format(string, sizeof string, "Du wurdest von %s aus dem Haus geschmissen!", pn(playerid));SendClientMessage(pid, Grey, string);
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, "/destroyhouse", true))
{
if(PlayerInfo[playerid][pAdmin] == 1339)
{
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, "/hausschloss", 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(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, "/interiors", true))
{
if(PlayerInfo[playerid][pAdmin] >= 5)
{
for(new i = 0; i<sizeof(Interiors); i++)
{
format(string, sizeof string, "Interior Typ %d: %s, IntID: %d", i+1, Interiors[i][description]);
SendClientMessage(playerid, Grey, string);
}
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(string, sizeof string, "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, string);
SendClientMessage(playerid, Grey, "Tippe /wohungkündigen um vom Mietvertrag zurückzutreten!");
}
}
return 1;
}
//=========================================================================
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, "/hausschloss", 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(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, "/interiors", true))
{
if(PlayerInfo[playerid][pAdmin] >= 5)
{
for(new i = 0; i<sizeof(Interiors); i++)
{
format(string, sizeof string, "Interior Typ %d: %s, IntID: %d", i+1, Interiors[i][description]);
SendClientMessage(playerid, Grey, string);
}
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(string, sizeof string, "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, string);
SendClientMessage(playerid, Grey, "Tippe /wohungkündigen um vom Mietvertrag zurückzutreten!");
}
}
return 1;
}
//=========================================================================
Fehler Bild Haus :
Fehler Tank :
Was kann ich machen?
kann mir Jemand Helfen?
LG
Crocky