Das Problem ist wenn manche Spieler ein Biz kaufen wollen kommt die Meldung bei ihnen " Du hast bereits ein BIZ "
Wenn sie es verkaufen wollen kommt jedoch die Meldung " Du besitzt kein BIZ"
if(strcmp("/buybiz", cmd, true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, playername, sizeof(playername));
if(PlayerInfo[playerid][pBizKey] != -1)
{
SendClientMessage(playerid, COLOR_ERRORTEXT, " Du besitzt bereits ein Biz, benutze /sellbiz um es zu verkaufen!");
return 1;
}
for(new b = 0; b < sizeof(SBizInfo); b++){
if(PlayerToPoint(2.0, playerid, SBizInfo[b][sbEntranceX], SBizInfo[b][sbEntranceY], SBizInfo[b][sbEntranceZ]) && SBizInfo[b][sbOwned] == 0){
if(PlayerInfo[playerid][pLevel] < SBizInfo[b][sbLevelNeeded])
{
format(string, sizeof(string), " Du musst Level %d sein um dieses Biz kaufen zu können!",SBizInfo[b][sbLevelNeeded]);
SendClientMessage(playerid, COLOR_ERRORTEXT, string);
return 1;
}
if(PlayerInfo[playerid][pCash] >= SBizInfo[b][sbBuyPrice]){
PlayerInfo[playerid][pBizKey] = b+100;
SBizInfo[b][sbOwned] = 1;
StuffInfo[sSteuerkasse] += SBizInfo[b][sbBuyPrice];
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(SBizInfo[b][sbOwner], sendername, 0, strlen(sendername), 255);
GivePlayerMoneys(playerid,-SBizInfo[b][sbBuyPrice]);
PlayerPlayMusic(playerid);
SendClientMessage(playerid, COLOR_WHITE, "Gratulation, zum Erwerb eines Biz!");
SendClientMessage(playerid, COLOR_WHITE, "Benutze /help um die neuen Befehle zu sehen.");
Update3DTextsBiz(b);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_ERRORTEXT, " Soviel Geld hast du nicht!");
return 1;
}}}
for(new b = 0; b < sizeof(TankenBizInfo); b++){
if(PlayerToPoint(2.0, playerid, TankenBizInfo[b][TBPosX], TankenBizInfo[b][TBPosY], TankenBizInfo[b][TBPosZ]) && TankenBizInfo[b][TBOwned] == 0){
if(PlayerInfo[playerid][pLevel] < TankenBizInfo[b][TBLevelNeeded])
{
format(string, sizeof(string), " Du musst Level %d sein um dieses Biz kaufen zu können!", TankenBizInfo[b][TBLevelNeeded]);
SendClientMessage(playerid, COLOR_ERRORTEXT, string);
return 1;
}
if(PlayerInfo[playerid][pCash] >= TankenBizInfo[b][TBKaufPreis])
{
PlayerInfo[playerid][pBizKey] = b+200;
TankenBizInfo[b][TBOwned] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(TankenBizInfo[b][TBOwner], sendername, 0, strlen(sendername), 255);
GivePlayerMoneys(playerid, -TankenBizInfo[b][TBKaufPreis]);
StuffInfo[sSteuerkasse] += TankenBizInfo[b][TBKaufPreis];
SendClientMessage(playerid, COLOR_WHITE, "Gratulation, zum Erwerb eines Tanken Biz!");
SendClientMessage(playerid, COLOR_WHITE, "Benutze /help um die neuen Befehle zu sehen.");
Update3DTextTanke(b);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_ERRORTEXT, " Soviel Geld hast du nicht!");
return 1;
}}}
for(new b = 0; b < sizeof(BizInfo); b++){
if(PlayerToPoint(2.0, playerid, BizInfo[b][bEntranceX], BizInfo[b][bEntranceY], BizInfo[b][bEntranceZ]) && BizInfo[b][bOwned] == 0){
if(PlayerInfo[playerid][pLevel] < BizInfo[b][bLevelNeeded])
{
format(string, sizeof(string), "Du musst mindestens Level %d sein um die das kaufen zu können.",BizInfo[b][bLevelNeeded]);
SendClientMessage(playerid, COLOR_ERRORTEXT, string);
return 1;
}
if(PlayerInfo[playerid][pCash] >= BizInfo[b][bBuyPrice])
{
PlayerInfo[playerid][pBizKey] = b;
BizInfo[b][bOwned] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(BizInfo[b][bOwner], sendername, 0, strlen(sendername), 255);
GivePlayerMoneys(playerid,-BizInfo[b][bBuyPrice]);
PlayerPlayMusic(playerid);
SetPlayerInterior(playerid,BizInfo[b][bInterior]);
StuffInfo[sSteuerkasse] += BizInfo[b][bBuyPrice];
SetPlayerPos(playerid,BizInfo[b][bExitX],BizInfo[b][bExitY],BizInfo[b][bExitZ]);
GameTextForPlayer(playerid, "~w~Willkommen~n~Du kannst das Biz jederzeit verlassen mit /exit", 5000, 3);
PlayerInfo[playerid][pLocal] = b;
SendClientMessage(playerid, COLOR_WHITE, "Gratulation, du bist nun in deinem Biz!");
SendClientMessage(playerid, COLOR_WHITE, "Benutze /help um die neuen Befehle zu sehen.");
Update3DTextBiz(b);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_ERRORTEXT, " Soviel Geld hast du nicht!");
return 1;
}}}}
return 1;
}
if(strcmp("/sellbiz", cmd, true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, playername, sizeof(playername));
if(PlayerInfo[playerid][pBizKey] == -1)
{
SendClientMessage(playerid, COLOR_ERRORTEXT, " Du besitzt kein Biz!");
return 1;
}
if(PlayerInfo[playerid][pBizKey] != -1 && PlayerInfo[playerid][pBizKey] <= 99 && strcmp(playername, BizInfo[PlayerInfo[playerid][pBizKey]][bOwner], true) == 0)
{
new BizKey = PlayerInfo[playerid][pBizKey];
GivePlayerMoneys(playerid, BizInfo[BizKey][bTill]);
GivePlayerMoneys(playerid, (BizInfo[BizKey][bBuyPrice]/2));
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(BizInfo[BizKey][bOwner], "Staat", 0, strlen("Staat"), 255);
strmid(BizInfo[BizKey][bExtortion], "Niemand", 0, strlen("Niemand"), 255);
BizInfo[BizKey][bLocked] = 1;
BizInfo[BizKey][bTill] = 0;
BizInfo[BizKey][bOwned] = 0;
PlayerInfo[playerid][pBizKey] = -1;
format(string, sizeof(string), "~w~Gratulation~n~ Du hast dein Biz fuer ~n~~g~$%d~n~~w~verkauft", (BizInfo[BizKey][bTill]+(BizInfo[BizKey][bBuyPrice]/2)));
GameTextForPlayer(playerid, string, 10000, 3);
Update3DTextBiz(BizKey);
return 1;
}
if(PlayerInfo[playerid][pBizKey] >= 100 && PlayerInfo[playerid][pBizKey] <= 199 && strcmp(playername, SBizInfo[PlayerInfo[playerid][pBizKey]-100][sbOwner], true) == 0)
{
new BizKey = PlayerInfo[playerid][pBizKey]-100;
GivePlayerMoneys(playerid, SBizInfo[BizKey][sbTill]);
GivePlayerMoneys(playerid, (SBizInfo[BizKey][sbBuyPrice]/2));
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(SBizInfo[BizKey][sbOwner], "Staat", 0, strlen("Staat"), 255);
strmid(SBizInfo[BizKey][sbExtortion], "Niemand", 0, strlen("Niemand"), 255);
SBizInfo[BizKey][sbLocked] = 1;
SBizInfo[BizKey][sbTill] = 0;
SBizInfo[BizKey][sbOwned] = 0;
PlayerInfo[playerid][pBizKey] = -1;
format(string, sizeof(string), "~w~Gratulation~n~ Du hast dein Biz fuer ~n~~g~$%d~n~~w~verkauft", (SBizInfo[BizKey][sbTill]+(SBizInfo[BizKey][sbBuyPrice]/2)));
GameTextForPlayer(playerid, string, 10000, 3);
Update3DTextsBiz(BizKey);
return 1;
}
if(PlayerInfo[playerid][pBizKey] >= 200 && PlayerInfo[playerid][pBizKey] <= 299 && strcmp(playername, TankenBizInfo[PlayerInfo[playerid][pBizKey]-200][TBOwner], true) == 0)
{
new BizKey = PlayerInfo[playerid][pBizKey]-200;
GivePlayerMoneys(playerid,TankenBizInfo[BizKey][TBKasse]);
GivePlayerMoneys(playerid, (TankenBizInfo[BizKey][TBKaufPreis]/2));
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(TankenBizInfo[BizKey][TBOwner], "Staat", 0, strlen("Staat"), 255);
strmid(TankenBizInfo[BizKey][TBExtortion], "Niemand", 0, strlen("Niemand"), 255);
TankenBizInfo[BizKey][TBLocked] = 1;
TankenBizInfo[BizKey][TBKasse] = 0;
TankenBizInfo[BizKey][TBOwned] = 0;
PlayerInfo[playerid][pBizKey] = -1;
format(string, sizeof(string), "~w~Gratulation~n~ Du hast dein Biz fuer ~n~~g~$%d~n~~w~verkauft", (TankenBizInfo[BizKey][TBKasse]+(TankenBizInfo[BizKey][TBKaufPreis]/2)));
GameTextForPlayer(playerid, string, 10000, 3);
Update3DTextTanke(BizKey);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_ERRORTEXT, " Du besitzt kein Biz!");
}
}
return 1;
}
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, playername, sizeof(playername));
if(PlayerInfo[playerid][pBizKey] != -1)
{
SendClientMessage(playerid, COLOR_ERRORTEXT, " Du besitzt bereits ein Biz, benutze /sellbiz um es zu verkaufen!");
return 1;
}
for(new b = 0; b < sizeof(SBizInfo); b++){
if(PlayerToPoint(2.0, playerid, SBizInfo[b][sbEntranceX], SBizInfo[b][sbEntranceY], SBizInfo[b][sbEntranceZ]) && SBizInfo[b][sbOwned] == 0){
if(PlayerInfo[playerid][pLevel] < SBizInfo[b][sbLevelNeeded])
{
format(string, sizeof(string), " Du musst Level %d sein um dieses Biz kaufen zu können!",SBizInfo[b][sbLevelNeeded]);
SendClientMessage(playerid, COLOR_ERRORTEXT, string);
return 1;
}
if(PlayerInfo[playerid][pCash] >= SBizInfo[b][sbBuyPrice]){
PlayerInfo[playerid][pBizKey] = b+100;
SBizInfo[b][sbOwned] = 1;
StuffInfo[sSteuerkasse] += SBizInfo[b][sbBuyPrice];
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(SBizInfo[b][sbOwner], sendername, 0, strlen(sendername), 255);
GivePlayerMoneys(playerid,-SBizInfo[b][sbBuyPrice]);
PlayerPlayMusic(playerid);
SendClientMessage(playerid, COLOR_WHITE, "Gratulation, zum Erwerb eines Biz!");
SendClientMessage(playerid, COLOR_WHITE, "Benutze /help um die neuen Befehle zu sehen.");
Update3DTextsBiz(b);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_ERRORTEXT, " Soviel Geld hast du nicht!");
return 1;
}}}
for(new b = 0; b < sizeof(TankenBizInfo); b++){
if(PlayerToPoint(2.0, playerid, TankenBizInfo[b][TBPosX], TankenBizInfo[b][TBPosY], TankenBizInfo[b][TBPosZ]) && TankenBizInfo[b][TBOwned] == 0){
if(PlayerInfo[playerid][pLevel] < TankenBizInfo[b][TBLevelNeeded])
{
format(string, sizeof(string), " Du musst Level %d sein um dieses Biz kaufen zu können!", TankenBizInfo[b][TBLevelNeeded]);
SendClientMessage(playerid, COLOR_ERRORTEXT, string);
return 1;
}
if(PlayerInfo[playerid][pCash] >= TankenBizInfo[b][TBKaufPreis])
{
PlayerInfo[playerid][pBizKey] = b+200;
TankenBizInfo[b][TBOwned] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(TankenBizInfo[b][TBOwner], sendername, 0, strlen(sendername), 255);
GivePlayerMoneys(playerid, -TankenBizInfo[b][TBKaufPreis]);
StuffInfo[sSteuerkasse] += TankenBizInfo[b][TBKaufPreis];
SendClientMessage(playerid, COLOR_WHITE, "Gratulation, zum Erwerb eines Tanken Biz!");
SendClientMessage(playerid, COLOR_WHITE, "Benutze /help um die neuen Befehle zu sehen.");
Update3DTextTanke(b);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_ERRORTEXT, " Soviel Geld hast du nicht!");
return 1;
}}}
for(new b = 0; b < sizeof(BizInfo); b++){
if(PlayerToPoint(2.0, playerid, BizInfo[b][bEntranceX], BizInfo[b][bEntranceY], BizInfo[b][bEntranceZ]) && BizInfo[b][bOwned] == 0){
if(PlayerInfo[playerid][pLevel] < BizInfo[b][bLevelNeeded])
{
format(string, sizeof(string), "Du musst mindestens Level %d sein um die das kaufen zu können.",BizInfo[b][bLevelNeeded]);
SendClientMessage(playerid, COLOR_ERRORTEXT, string);
return 1;
}
if(PlayerInfo[playerid][pCash] >= BizInfo[b][bBuyPrice])
{
PlayerInfo[playerid][pBizKey] = b;
BizInfo[b][bOwned] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(BizInfo[b][bOwner], sendername, 0, strlen(sendername), 255);
GivePlayerMoneys(playerid,-BizInfo[b][bBuyPrice]);
PlayerPlayMusic(playerid);
SetPlayerInterior(playerid,BizInfo[b][bInterior]);
StuffInfo[sSteuerkasse] += BizInfo[b][bBuyPrice];
SetPlayerPos(playerid,BizInfo[b][bExitX],BizInfo[b][bExitY],BizInfo[b][bExitZ]);
GameTextForPlayer(playerid, "~w~Willkommen~n~Du kannst das Biz jederzeit verlassen mit /exit", 5000, 3);
PlayerInfo[playerid][pLocal] = b;
SendClientMessage(playerid, COLOR_WHITE, "Gratulation, du bist nun in deinem Biz!");
SendClientMessage(playerid, COLOR_WHITE, "Benutze /help um die neuen Befehle zu sehen.");
Update3DTextBiz(b);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_ERRORTEXT, " Soviel Geld hast du nicht!");
return 1;
}}}}
return 1;
}
if(strcmp("/sellbiz", cmd, true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, playername, sizeof(playername));
if(PlayerInfo[playerid][pBizKey] == -1)
{
SendClientMessage(playerid, COLOR_ERRORTEXT, " Du besitzt kein Biz!");
return 1;
}
if(PlayerInfo[playerid][pBizKey] != -1 && PlayerInfo[playerid][pBizKey] <= 99 && strcmp(playername, BizInfo[PlayerInfo[playerid][pBizKey]][bOwner], true) == 0)
{
new BizKey = PlayerInfo[playerid][pBizKey];
GivePlayerMoneys(playerid, BizInfo[BizKey][bTill]);
GivePlayerMoneys(playerid, (BizInfo[BizKey][bBuyPrice]/2));
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(BizInfo[BizKey][bOwner], "Staat", 0, strlen("Staat"), 255);
strmid(BizInfo[BizKey][bExtortion], "Niemand", 0, strlen("Niemand"), 255);
BizInfo[BizKey][bLocked] = 1;
BizInfo[BizKey][bTill] = 0;
BizInfo[BizKey][bOwned] = 0;
PlayerInfo[playerid][pBizKey] = -1;
format(string, sizeof(string), "~w~Gratulation~n~ Du hast dein Biz fuer ~n~~g~$%d~n~~w~verkauft", (BizInfo[BizKey][bTill]+(BizInfo[BizKey][bBuyPrice]/2)));
GameTextForPlayer(playerid, string, 10000, 3);
Update3DTextBiz(BizKey);
return 1;
}
if(PlayerInfo[playerid][pBizKey] >= 100 && PlayerInfo[playerid][pBizKey] <= 199 && strcmp(playername, SBizInfo[PlayerInfo[playerid][pBizKey]-100][sbOwner], true) == 0)
{
new BizKey = PlayerInfo[playerid][pBizKey]-100;
GivePlayerMoneys(playerid, SBizInfo[BizKey][sbTill]);
GivePlayerMoneys(playerid, (SBizInfo[BizKey][sbBuyPrice]/2));
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(SBizInfo[BizKey][sbOwner], "Staat", 0, strlen("Staat"), 255);
strmid(SBizInfo[BizKey][sbExtortion], "Niemand", 0, strlen("Niemand"), 255);
SBizInfo[BizKey][sbLocked] = 1;
SBizInfo[BizKey][sbTill] = 0;
SBizInfo[BizKey][sbOwned] = 0;
PlayerInfo[playerid][pBizKey] = -1;
format(string, sizeof(string), "~w~Gratulation~n~ Du hast dein Biz fuer ~n~~g~$%d~n~~w~verkauft", (SBizInfo[BizKey][sbTill]+(SBizInfo[BizKey][sbBuyPrice]/2)));
GameTextForPlayer(playerid, string, 10000, 3);
Update3DTextsBiz(BizKey);
return 1;
}
if(PlayerInfo[playerid][pBizKey] >= 200 && PlayerInfo[playerid][pBizKey] <= 299 && strcmp(playername, TankenBizInfo[PlayerInfo[playerid][pBizKey]-200][TBOwner], true) == 0)
{
new BizKey = PlayerInfo[playerid][pBizKey]-200;
GivePlayerMoneys(playerid,TankenBizInfo[BizKey][TBKasse]);
GivePlayerMoneys(playerid, (TankenBizInfo[BizKey][TBKaufPreis]/2));
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(TankenBizInfo[BizKey][TBOwner], "Staat", 0, strlen("Staat"), 255);
strmid(TankenBizInfo[BizKey][TBExtortion], "Niemand", 0, strlen("Niemand"), 255);
TankenBizInfo[BizKey][TBLocked] = 1;
TankenBizInfo[BizKey][TBKasse] = 0;
TankenBizInfo[BizKey][TBOwned] = 0;
PlayerInfo[playerid][pBizKey] = -1;
format(string, sizeof(string), "~w~Gratulation~n~ Du hast dein Biz fuer ~n~~g~$%d~n~~w~verkauft", (TankenBizInfo[BizKey][TBKasse]+(TankenBizInfo[BizKey][TBKaufPreis]/2)));
GameTextForPlayer(playerid, string, 10000, 3);
Update3DTextTanke(BizKey);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_ERRORTEXT, " Du besitzt kein Biz!");
}
}
return 1;
}