Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(strcmp(cmd, "/buybiz", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:oldposx, Float:oldposy, Float:oldposz;
- GetPlayerName(playerid, playername, sizeof(playername));
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- if(PlayerInfo[playerid][pPbiskey] != 255)
- {
- SendClientMessage(playerid, COLOR_WHITE, " Du besitzt schon ein Business, tipp /sellbiz wenn du dieses willst.");
- return 1;
- }
- for(new b = 0; b < sizeof(SBizzInfo); b++)
- {
- if(IsPlayerInRangeOfPoint(playerid,2.0, SBizzInfo[b][sbEntranceX], SBizzInfo[b][sbEntranceY], SBizzInfo[b][sbEntranceZ]) && SBizzInfo[b][sbOwned] == 0)
- {
- if(PlayerInfo[playerid][pLevel] < SBizzInfo[b][sbLevelNeeded])
- {
- format(string, sizeof(string), "Du benötigst Level %d um es erwerben zu können",SBizzInfo[b][sbLevelNeeded]);
- SendClientMessage(playerid, COLOR_GRAD5, string);
- return 1;
- }
- if(GetPlayerMoney(playerid) > SBizzInfo[b][sbBuyPrice])
- {
- PlayerInfo[playerid][pPbiskey] = b+100;
- SBizzInfo[b][sbOwned] = 1;
- GetPlayerName(playerid, sendername, sizeof(sendername));
- strmid(SBizzInfo[b][sbOwner], sendername, 0, strlen(sendername), 255);
- GivePlayerMoney(playerid,-SBizzInfo[b][sbBuyPrice]);
- PlayerPlayMusic(playerid);
- SendClientMessage(playerid, COLOR_WHITE, "Gratulation für dein neues Gewerbe.");
- SendClientMessage(playerid, COLOR_WHITE, "Gib /help ein, um Hilfe für dein neues Gewerbe zu bekommen.");
- DateProp(playerid);
- new string4[200];
- format(string4, sizeof(string4), "[%s]\nInhaber: %s\nTeilhaber: %s\nEintrittspreis: %d$\nLevel: %d\nProdukte: %d/%d\nPreis pro Produkt: %d", SBizzInfo[b][sbMessage],SBizzInfo[b][sbOwner],SBizzInfo[b][sbExtortion],SBizzInfo[b][sbEntranceCost],SBizzInfo[b][sbLevelNeeded],SBizzInfo[b][sbProducts],SBizzInfo[b][sbMaxProducts], SBizzInfo[b][sbPriceProd]);
- Update3DTextLabelText(SBizzInfo[b][sbText],COLOR_BUYED,string4);
- OnPropUpdate();
- PlayerUpdate(playerid);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_WHITE, "Du hast nicht genug Geld, um das Gewerbe kaufen zu können.");
- return 1;
- }
- }
- }
- for(new b = 0; b < sizeof(BizzInfo); b++)
- {
- if(IsPlayerInRangeOfPoint(playerid,2.0, BizzInfo[b][bEntranceX], BizzInfo[b][bEntranceY], BizzInfo[b][bEntranceZ]) && BizzInfo[b][bOwned] == 0)
- {
- if(PlayerInfo[playerid][pLevel] < BizzInfo[b][bLevelNeeded])
- {
- format(string, sizeof(string), "Du benötigst mindestens Level %d, um es kaufen zu können",BizzInfo[b][bLevelNeeded]);
- SendClientMessage(playerid, COLOR_GRAD5, string);
- return 1;
- }
- if(GetPlayerMoney(playerid) > BizzInfo[b][bBuyPrice])
- {
- PlayerInfo[playerid][pPbiskey] = b;
- BizzInfo[b][bOwned] = 1;
- GetPlayerName(playerid, sendername, sizeof(sendername));
- strmid(BizzInfo[b][bOwner], sendername, 0, strlen(sendername), 255);
- GivePlayerMoney(playerid,-BizzInfo[b][bBuyPrice]);
- PlayerPlayMusic(playerid);
- SetPlayerInterior(playerid,BizzInfo[b][bInterior]);
- PlayerInfo[playerid][pInt] = BizzInfo[b][bInterior];
- SetPlayerPos(playerid,BizzInfo[b][bExitX],BizzInfo[b][bExitY],BizzInfo[b][bExitZ]);
- GameTextForPlayer(playerid, "~w~Willkommen~n~Um es zu Verlassen tipp /exit (An der Tuer) ein", 5000, 3);
- PlayerInfo[playerid][pInt] = BizzInfo[b][bInterior];
- PlayerInfo[playerid][pLocal] = b ;
- SendClientMessage(playerid, COLOR_WHITE, "Gratulation für dein neues Gewerbe.");
- SendClientMessage(playerid, COLOR_WHITE, "Gib /help ein, um Hilfe für dein neues Gewerbe zu bekommen.");
- DateProp(playerid);
- //Label Update
- new string3[128];
- format(string3, sizeof(string3), "[%s]\nInhaber: %s\nTeilhaber: %s\nEintrittspreis: %d$\nLevel: %d\nProdukte: %d/%d\nPreis pro Produkt: %d", BizzInfo[b][bMessage],BizzInfo[b][bOwner],BizzInfo[b][bExtortion],BizzInfo[b][bEntranceCost],BizzInfo[b][bLevelNeeded],BizzInfo[b][bProducts],BizzInfo[b][bMaxProducts],BizzInfo[b][bPriceProd]);
- Update3DTextLabelText(BizzInfo[b][bText],COLOR_BUYED,string3);
- //Speichern
- OnPropUpdate();
- PlayerUpdate(playerid);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_WHITE, "Du hast nicht genug Geld, um das Gewerbe kaufen zu können.");
- return 1;
- }
- }
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/sellbiz", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- GetPlayerName(playerid, playername, sizeof(playername));
- if(PlayerInfo[playerid][pPbiskey] == 255)
- {
- SendClientMessage(playerid, COLOR_WHITE, "Du besitzt kein Gewerbe.");
- return 1;
- }
- if(PlayerInfo[playerid][pMarried] > 0)
- {
- SendClientMessage(playerid, COLOR_GREY, " Du bist Verheiratet, also kannst du dein Haus nicht verkaufen !");
- return 1;
- }
- if(PlayerInfo[playerid][pPbiskey] >= 100 && strcmp(playername, SBizzInfo[PlayerInfo[playerid][pPbiskey]-100][sbOwner], true) == 0)
- {
- new bouse = PlayerInfo[playerid][pPbiskey]-100;
- GivePlayerMoney(playerid,SBizzInfo[bouse][sbTill]);
- SBizzInfo[bouse][sbLocked] = 1;
- SBizzInfo[bouse][sbOwned] = 0;
- GetPlayerName(playerid, sendername, sizeof(sendername));
- strmid(SBizzInfo[bouse][sbOwner], "The State", 0, strlen("The State"), 255);
- strmid(SBizzInfo[bouse][sbExtortion], "No-one", 0, strlen("No-one"), 255);
- ConsumingMoney[playerid] = 1;
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- format(string, sizeof(string), "~w~Gluekwunsch~n~ Du hast dein Geschaeft verkauft. Premie ~n~~g~$%d", SBizzInfo[bouse][sbTill]);
- GameTextForPlayer(playerid, string, 10000, 3);
- SBizzInfo[bouse][sbTill] = 0;
- PlayerInfo[playerid][pPbiskey] = 255;
- //Labe Update
- new string4[160];
- format(string4, sizeof(string4), "[Business zu Verkaufen - %s]\nPreis: %d$\nLevel: %d", SBizzInfo[bouse][sbMessage],SBizzInfo[bouse][sbBuyPrice],SBizzInfo[bouse][sbLevelNeeded]);
- Update3DTextLabelText(SBizzInfo[bouse][sbText],COLOR_FORSELL,string4);
- //Speichern
- OnPropUpdate();
- PlayerUpdate(playerid);
- return 1;
- }
- if(strcmp(playername, BizzInfo[PlayerInfo[playerid][pPbiskey]][bOwner], true) == 0)
- {
- new bouse = PlayerInfo[playerid][pPbiskey];
- BizzInfo[bouse][bLocked] = 1;
- BizzInfo[bouse][bOwned] = 0;
- GetPlayerName(playerid, sendername, sizeof(sendername));
- strmid(BizzInfo[bouse][bOwner], "The State", 0, strlen("The State"), 255);
- strmid(BizzInfo[bouse][bExtortion], "No-one", 0, strlen("No-one"), 255);
- ConsumingMoney[playerid] = 1;
- GivePlayerMoney(playerid,BizzInfo[bouse][bTill]);
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- format(string, sizeof(string), "~w~Gluekwunsch~n~ Du hast dein Geschaeft verkauft. Premie ~n~~g~$%d", BizzInfo[bouse][bTill]);
- GameTextForPlayer(playerid, string, 10000, 3);
- BizzInfo[bouse][bTill] = 0;
- PlayerInfo[playerid][pPbiskey] = 255;
- //Labe Update
- new string3[160];
- format(string3, sizeof(string3), "[Business zu Verkaufen - %s]\nPreis: %d$\nLevel: %d", BizzInfo[bouse][bMessage],BizzInfo[bouse][bBuyPrice],BizzInfo[bouse][bLevelNeeded]);
- Update3DTextLabelText(BizzInfo[bouse][bText],COLOR_FORSELL,string3);
- //Speichern
- OnPropUpdate();
- PlayerUpdate(playerid);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_WHITE, "Dir gehört kein Geschäfft.");
- }
- }
- return 1;
- }
- if (strcmp(cmd, "/bizinfo", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- new bouse = PlayerInfo[playerid][pPbiskey];
- if(bouse == 255)
- {
- SendClientMessage(playerid, COLOR_WHITE, "Dir gehört kein Geschäfft.");
- return 1;
- }
- if (bouse >= 100)
- {
- PrintSBizInfo(playerid,bouse-100);
- }
- else
- {
- PrintBizInfo(playerid,bouse);
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/prodprice", true) == 0)
- {
- new bouse = PlayerInfo[playerid][pPbiskey];
- if (bouse == 255)
- {
- SendClientMessage(playerid, COLOR_GRAD2, "Dir gehört kein Geschäfft");
- return 1;
- }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_WHITE, "FEHLER: /prodprice [kosten pro Produkt]");
- }
- if(strval(tmp) < 10 || strval(tmp) > 5000)
- {
- SendClientMessage(playerid, COLOR_WHITE, "Der Prodpreis muss mindestens 10$ sein und kann höchsten 5000$ sein.");
- return 1;
- }
- if (bouse >= 100)
- {
- if(strval(tmp) > SBizzInfo[bouse-100][sbTill])
- {
- SendClientMessage(playerid, COLOR_WHITE, "Nicht genug Geld in der Businesskasse");
- return 1;
- }
- SBizzInfo[bouse-100][sbPriceProd] = strval(tmp);
- format(string, sizeof(string), "Produkte werden nun für %d$ / Produkt gekauft.", SBizzInfo[bouse-100][sbPriceProd]);
- new string4[160];
- if(SBizzInfo[bouse-100][sbOwned] == 1)
- {
- format(string4, sizeof(string4), "[%s]\nInhaber: %s\nTeilhaber: %s\nEintrittspreis: %d$\nLevel: %d\nProdukte: %d/%d\nPreis pro Produkt: %d", SBizzInfo[bouse-100][sbMessage],SBizzInfo[bouse-100][sbOwner],SBizzInfo[bouse-100][sbExtortion],SBizzInfo[bouse-100][sbEntranceCost],SBizzInfo[bouse-100][sbLevelNeeded],SBizzInfo[bouse-100][sbProducts],SBizzInfo[bouse-100][sbMaxProducts], SBizzInfo[bouse-100][sbPriceProd]);
- Update3DTextLabelText(SBizzInfo[bouse-100][sbText],COLOR_BUYED,string4);
- }
- }
- else
- {
- if(strval(tmp) > BizzInfo[bouse][bTill])
- {
- SendClientMessage(playerid, COLOR_WHITE, "Nicht genug Geld inder Businesskasse");
- return 1;
- }
- BizzInfo[bouse][bPriceProd] = strval(tmp);
- format(string, sizeof(string), "Produkte werden nun für %d$ / Produkt gekauft.", BizzInfo[bouse][bPriceProd]);
- new string3[200];
- if(BizzInfo[bouse][bOwned] == 1)
- {
- format(string3, sizeof(string3), "[%s]\nInhaber: %s\nTeilhaber: %s\nEintrittspreis: %d$\nLevel: %d\nProdukte: %d/%d\nPreis pro Produkt: %d", BizzInfo[bouse][bMessage],BizzInfo[bouse][bOwner],BizzInfo[bouse][bExtortion],BizzInfo[bouse][bEntranceCost],BizzInfo[bouse][bLevelNeeded],BizzInfo[bouse][bProducts],BizzInfo[bouse][bMaxProducts],BizzInfo[bouse][bPriceProd]);
- Update3DTextLabelText(BizzInfo[bouse][bText],COLOR_BUYED,string3);
- }
- }
- OnPropUpdate();
- SendClientMessage(playerid, COLOR_WHITE, string);
- return 1;
- }
- if(strcmp(cmd, "/bizfee", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- new bouse = PlayerInfo[playerid][pPbiskey];
- if (bouse == 255)
- {
- SendClientMessage(playerid, COLOR_GRAD2, "Dir gehört kein Geschäfft!");
- return 1;
- }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_WHITE, "NUTZE: /bizfee [Preis]");
- }
- if(strval(tmp) < 0 || strval(tmp) > 250 && bouse != 102 && bouse != 105)
- {
- SendClientMessage(playerid, COLOR_WHITE, "Minimaler eintritt ist $0, Maximaler eintritt ist $250.");
- return 1;
- }
- if(bouse == 102)
- {
- if(strval(tmp) < 0 || strval(tmp) > 50)
- {
- SendClientMessage(playerid, COLOR_GRAD1, "Minimaler Spritpreis ist 0$, Maximaler Sprittpreis 50$.");
- }
- }
- if(bouse == 105)
- {
- if(strval(tmp) < 0 || strval(tmp) > 50)
- {
- SendClientMessage(playerid, COLOR_GRAD1, "Maximaler Preis pro Buchstabe: 50$, Minimaler Preis: 0$!");
- return 1;
- }
- }
- if (bouse >= 100)
- {
- SBizzInfo[bouse-100][sbEntranceCost] = strval(tmp);
- format(string, sizeof(string), "Eintritts Preis wurde auf $%d gesetzt.", SBizzInfo[bouse-100][sbEntranceCost]);
- SendClientMessage(playerid, COLOR_GREEN, "Eintritts Preis wurde auf $%d gesetzt!");
- }
- else
- {
- BizzInfo[bouse][bEntranceCost] = strval(tmp);
- format(string, sizeof(string), "Eintritts Preis wurde auf $%d gesetzt.", BizzInfo[bouse][bEntranceCost]);
- SendClientMessage(playerid, COLOR_GREEN, "Eintritts Preis wurde auf $%d gesetzt!");
- }
- new string3[160];
- if(BizzInfo[bouse][bOwned] == 1)
- {
- format(string3, sizeof(string3), "[%s]\nInhaber: %s\nTeilhaber: %s\nEintrittspreis: %d$\nLevel: %d\nProdukte: %d/%d\nPreis pro Produkt: %d", BizzInfo[bouse][bMessage],BizzInfo[bouse][bOwner],BizzInfo[bouse][bExtortion],BizzInfo[bouse][bEntranceCost],BizzInfo[bouse][bLevelNeeded],BizzInfo[bouse][bProducts],BizzInfo[bouse][bMaxProducts],BizzInfo[bouse][bPriceProd]);
- Update3DTextLabelText(BizzInfo[bouse][bText],COLOR_BUYED,string3);
- }
- new string4[160];
- if(SBizzInfo[bouse-100][sbOwned] == 1)
- {
- format(string4, sizeof(string4), "[%s]\nInhaber: %s\nTeilhaber: %s\nEintrittspreis: %d$\nLevel: %d\nProdukte: %d/%d\nPreis pro Produkt: %d", SBizzInfo[bouse-100][sbMessage],SBizzInfo[bouse-100][sbOwner],SBizzInfo[bouse-100][sbExtortion],SBizzInfo[bouse-100][sbEntranceCost],SBizzInfo[bouse-100][sbLevelNeeded],SBizzInfo[bouse-100][sbProducts],SBizzInfo[bouse-100][sbMaxProducts], SBizzInfo[bouse-100][sbPriceProd]);
- Update3DTextLabelText(SBizzInfo[bouse-100][sbText],COLOR_BUYED,string4);
- }
- OnPropUpdate();
- SendClientMessage(playerid, COLOR_WHITE, string);
- }
- return 1;
- }
- if(strcmp(cmd, "/teilhaber", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- new bouse = PlayerInfo[playerid][pPbiskey];
- if (bouse == 255)
- {
- SendClientMessage(playerid, COLOR_GRAD2, " Dir gehört kein Geschäfft");
- return 1;
- }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_WHITE, "NUTZUNG: /teilhaber [playerid] (oder 555 für keinen)");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- format(string, sizeof(string), "* %s ist nun Teilhaber.",giveplayer);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "* %s hat sein Business geteilt, nun bist du Teilhaber.",sendername);
- SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
- if (bouse >= 100)
- {
- format(string, sizeof(string), "%s",giveplayer);
- strmid(SBizzInfo[bouse-100][sbExtortion], string, 0, sizeof(string), 255);
- format(string, sizeof(string), "Business Teilhaber Name = %s",SBizzInfo[bouse-100][sbExtortion]);
- format(ALLSTRING, sizeof(ALLSTRING), "[Business zu Verkaufen - %s]\nPreis: %d$\nLevel: %d", SBizzInfo[bouse-100][sbMessage],SBizzInfo[bouse-100][sbBuyPrice],SBizzInfo[bouse-100][sbLevelNeeded]);
- Update3DTextLabelText(SBizzInfo[bouse-100][sbText], COLOR_FORSELL, ALLSTRING);
- }
- else
- {
- format(string, sizeof(string), "%s",giveplayer);
- strmid(BizzInfo[bouse][bExtortion], string, 0, sizeof(string), 255);
- format(string, sizeof(string), "Business Teilhaber Name = %s",BizzInfo[bouse][bExtortion]);
- format(ALLSTRING, sizeof(ALLSTRING), "[Business zu Verkaufen - %s]\nPreis: %d$\nLevel: %d", BizzInfo[bouse][bMessage],BizzInfo[bouse][bBuyPrice],BizzInfo[bouse][bLevelNeeded]);
- Update3DTextLabelText(BizzInfo[bouse][bText], COLOR_FORSELL, ALLSTRING);
- }
- OnPropUpdate();
- SendClientMessage(playerid, COLOR_WHITE, string);
- }
- }
- else if(giveplayerid == 555)
- {
- if (bouse >= 100)
- {
- format(string, sizeof(string), "Niemand");
- strmid(SBizzInfo[bouse-100][sbExtortion], string, 0, sizeof(string), 255);
- format(string, sizeof(string), "Business Teilhaber Name = %s",SBizzInfo[bouse-100][sbExtortion]);
- }
- else
- {
- format(string, sizeof(string), "Niemand");
- strmid(BizzInfo[bouse][bExtortion], string, 0, sizeof(string), 255);
- format(string, sizeof(string), "Business Teilhaber Name = %s",BizzInfo[bouse][bExtortion]);
- }
- OnPropUpdate();
- SendClientMessage(playerid, COLOR_WHITE, string);
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, " Der Spieler ist Offline !");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/tankteilhaber", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- new bouse = PlayerInfo[playerid][pPtankekey];
- if (bouse == 255)
- {
- SendClientMessage(playerid, COLOR_GRAD2, "Dir gehört keine Tankstelle!");
- return 1;
- }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_WHITE, "NUTZUNG: /tankteilhaber [playerid] (oder 555 für keinen)");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- format(string, sizeof(string), "* %s ist nun Teilhaber.",giveplayer);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "* %s hat seine Tankstelle geteilt, nun bist du Teilhaber.",sendername);
- SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
- if (bouse >= 100)
- {
- format(string, sizeof(string), "%s",giveplayer);
- //strmid(TankeInfo[bouse-100][tExtortion], string, 0, sizeof(string), 255);
- format(string, sizeof(string), "Tankstellen Teilhaber Name = %s",TankeInfo[bouse-100][tExtortion]);
- }
- OnPropUpdate();
- SendClientMessage(playerid, COLOR_WHITE, string);
- }
- }
- else if(giveplayerid == 555)
- {
- if (bouse >= 100)
- {
- format(string, sizeof(string), "Niemand");
- strmid(SBizzInfo[bouse-100][sbExtortion], string, 0, sizeof(string), 255);
- format(string, sizeof(string), "Business Teilhaber Name = %s",SBizzInfo[bouse-100][sbExtortion]);
- }
- else
- {
- format(string, sizeof(string), "Niemand");
- strmid(BizzInfo[bouse][bExtortion], string, 0, sizeof(string), 255);
- format(string, sizeof(string), "Business Teilhaber Name = %s",BizzInfo[bouse][bExtortion]);
- }
- OnPropUpdate();
- SendClientMessage(playerid, COLOR_WHITE, string);
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/tankpreis", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- new bouse = PlayerInfo[playerid][pPtankekey];
- if (bouse == 255)
- {
- SendClientMessage(playerid, COLOR_GRAD2, "Dir gehört keine Tankstelle!");
- return 1;
- }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_WHITE, "NUTZE: /tankpreis [Preis pro Liter]");
- }
- if(strval(tmp) < 0 || strval(tmp) > 100)
- {
- SendClientMessage(playerid, COLOR_WHITE, "Minimaler Preis pro Liter ist $0, Maximaler Preis pro Liter ist $100.");
- return 1;
- }
- if (bouse >= 100)
- {
- TankeInfo[bouse-100][tEntranceCost] = strval(tmp);
- format(string, sizeof(string), "Preis pro Liter wurde auf $%d gesetzt.", TankeInfo[bouse-100][tEntranceCost]);
- }
- OnPropUpdate();
- SendClientMessage(playerid, COLOR_WHITE, string);
- }
- return 1;
- }
- if(strcmp(cmd, "/tankwithdraw", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- new bouse = PlayerInfo[playerid][pPtankekey];
- if (bouse == 255)
- {
- SendClientMessage(playerid, COLOR_GRAD2, "Dir gehört keine Tankstelle!");
- return 1;
- }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- if (bouse >= 100)
- {
- format(string, sizeof(string), "Du hast $%d in deiner Tankstellenkasse.", TankeInfo[bouse-100][tTill]);
- SendClientMessage(playerid, COLOR_GRAD3, string);
- }
- SendClientMessage(playerid, COLOR_GRAD2, "NUTZE: /tankwithdraw [Betrag]");
- return 1;
- }
- new cashdeposit = strval(tmp);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "NUTZE: /tankwithdraw [Betrag]");
- return 1;
- }
- if (bouse >= 100)
- {
- if(cashdeposit > TankeInfo[bouse-100][tTill] || cashdeposit < 1)
- {
- SendClientMessage(playerid, COLOR_GRAD2, "So viel Geld besitzt du nicht!");
- return 1;
- }
- }
- if (bouse >= 100)
- {
- if(!IsPlayerInRangeOfPoint(playerid,100.0,TankeInfo[bouse-100][tEntranceX],TankeInfo[bouse-100][tEntranceY],TankeInfo[bouse-100][tEntranceZ]))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "Du bist zu weit von deiner Tankstelle entfernt!");
- return 1;
- }
- else
- {
- ConsumingMoney[playerid] = 1;
- GivePlayerMoney(playerid,cashdeposit);
- TankeInfo[bouse-100][tTill] -= cashdeposit;
- ExtortionTanke(bouse-100, TankeInfo[bouse-100][tTill]);
- format(string, sizeof(string), "* Du hast $%d aus deiner Tankstellenkasse genommen. Total: $%d ", cashdeposit,TankeInfo[bouse-100][tTill]);
- OnPropUpdate();
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- return 1;
- }
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/tankbank", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- new bouse = PlayerInfo[playerid][pPtankekey];
- if (bouse == 255)
- {
- SendClientMessage(playerid, COLOR_GRAD2, "Dir gehört keine Tankstelle!");
- return 1;
- }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- if (bouse >= 100)
- {
- format(string, sizeof(string), "Du hast $%d in deiner Tankstellenkasse.", TankeInfo[bouse-100][tTill]);
- SendClientMessage(playerid, COLOR_GRAD3, string);
- }
- else
- {
- format(string, sizeof(string), " Du hast $%d in deiner Tankstellenkasse.", BizzInfo[bouse][bTill]);
- SendClientMessage(playerid, COLOR_GRAD3, string);
- }
- SendClientMessage(playerid, COLOR_GRAD2, "NUTZE: /tankbank [Betrag]");
- return 1;
- }
- new cashdeposit = strval(tmp);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "FEHLER: /tankbank [Betrag]");
- SendClientMessage(playerid, COLOR_GRAD3, string);
- return 1;
- }
- if (cashdeposit > GetPlayerMoney(playerid) || cashdeposit < 1)
- {
- SendClientMessage(playerid, COLOR_GRAD2, "So viel Geld hast du nicht auf deiner Hand!");
- return 1;
- }
- if (bouse >= 100)
- {
- if(!IsPlayerInRangeOfPoint(playerid,100.0,TankeInfo[bouse-100][tEntranceX],TankeInfo[bouse-100][tEntranceY],TankeInfo[bouse-100][tEntranceZ]))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "Du bist zu weit von deiner Tankstelle entfernt!");
- return 1;
- }
- else
- {
- TankeInfo[bouse-100][tTill] += cashdeposit;
- ExtortionTanke(bouse-100, TankeInfo[bouse-100][tTill]);
- GivePlayerMoney(playerid,-cashdeposit);
- format(string, sizeof(string), "* Du hast $%d in die Tankstellenkasse eingezahlt. Total: $%d ", cashdeposit,TankeInfo[bouse-100][tTill]);
- OnPropUpdate();
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- return 1;
- }
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/buytanke", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:oldposx, Float:oldposy, Float:oldposz;
- GetPlayerName(playerid, playername, sizeof(playername));
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- if(PlayerInfo[playerid][pPtankekey] != 255)
- {
- SendClientMessage(playerid, COLOR_WHITE, "Du besitzt schon eine Tankstelle, tippe /selltanke wenn du diese willst.");
- return 1;
- }
- for(new b = 0; b < sizeof(TankeInfo); b++)
- {
- if(IsPlayerInRangeOfPoint(playerid,2.0, TankeInfo[b][tEntranceX], TankeInfo[b][tEntranceY], TankeInfo[b][tEntranceZ]) && TankeInfo[b][tOwned] == 0)
- {
- if(PlayerInfo[playerid][pLevel] < TankeInfo[b][tLevelNeeded])
- {
- format(string, sizeof(string), "Du benötigst Level %d um es erwerben zu können",TankeInfo[b][tLevelNeeded]);
- SendClientMessage(playerid, COLOR_GRAD5, string);
- return 1;
- }
- if(GetPlayerMoney(playerid) > TankeInfo[b][tBuyPrice])
- {
- PlayerInfo[playerid][pPtankekey] = b+100;
- TankeInfo[b][tOwned] = 1;
- GetPlayerName(playerid, sendername, sizeof(sendername));
- strmid(TankeInfo[b][tOwner], sendername, 0, strlen(sendername), 255);
- GivePlayerMoney(playerid,-TankeInfo[b][tBuyPrice]);
- PlayerPlayMusic(playerid);
- SendClientMessage(playerid, COLOR_WHITE, "Glückwunsch zu deiner neuen Tankstelle!");
- SendClientMessage(playerid, COLOR_WHITE, "Gib /tankhelp ein um Hilfe für deine Tankstelle zu bekommen.");
- DateProp(playerid);
- OnPropUpdate();
- PlayerUpdate(playerid);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_WHITE, "Du hast nicht genug Geld, um diese Tankstelle kaufen zu können.");
- return 1;
- }
- }
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/selltanke", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- GetPlayerName(playerid, playername, sizeof(playername));
- if(PlayerInfo[playerid][pPtankekey] == 255)
- {
- SendClientMessage(playerid, COLOR_WHITE, "Du besitzt keine Tankstelle!");
- return 1;
- }
- if(PlayerInfo[playerid][pPtankekey] >= 100 && strcmp(playername, TankeInfo[PlayerInfo[playerid][pPtankekey]-100][tOwner], true) == 0)
- {
- new bouse = PlayerInfo[playerid][pPtankekey]-100;
- GivePlayerMoney(playerid,TankeInfo[bouse][tTill]);
- TankeInfo[bouse][tLocked] = 1;
- TankeInfo[bouse][tOwned] = 0;
- GetPlayerName(playerid, sendername, sizeof(sendername));
- strmid(TankeInfo[bouse][tOwner], "The State", 0, strlen("The State"), 255);
- strmid(TankeInfo[bouse][tExtortion], "No-one", 0, strlen("No-one"), 255);
- ConsumingMoney[playerid] = 1;
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- format(string, sizeof(string), "~w~Gluekwunsch~n~ Du hast deine Tankstelle verkauft. Premie ~n~~g~$%d", TankeInfo[bouse][tTill]);
- GameTextForPlayer(playerid, string, 10000, 3);
- TankeInfo[bouse][tTill] = 0;
- PlayerInfo[playerid][pPtankekey] = 255;
- OnPropUpdate();
- PlayerUpdate(playerid);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_WHITE, "Dir gehört keine Tankstelle!");
- }
- }
- return 1;
- }
- if (strcmp(cmd, "/tankinfo", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- new bouse = PlayerInfo[playerid][pPtankekey];
- if(bouse == 255)
- {
- SendClientMessage(playerid, COLOR_WHITE, "Dir gehört keine Tankstelle!");
- return 1;
- }
- if (bouse >= 100)
- {
- PrintFuelstationInfo(playerid,bouse-100);
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/bizname", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- new bouse = PlayerInfo[playerid][pPbiskey];
- if (bouse == 255)
- {
- SendClientMessage(playerid, COLOR_GRAD2, " Dir gehört kein Geschäfft");
- return 1;
- }
- new length = strlen(cmdtext);
- while ((idx < length) && (cmdtext[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[64];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = cmdtext[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- if(!strlen(result))
- {
- SendClientMessage(playerid, COLOR_WHITE, "NUTZE: /bizname [Name]");
- }
- if (bouse >= 100)
- {
- strmid(SBizzInfo[bouse-100][sbMessage], result, 0, 64, 255);
- format(string, sizeof(string), "Businessname wurde auf %s geändert",SBizzInfo[bouse-100][sbMessage]);
- }
- else
- {
- strmid(BizzInfo[bouse][bMessage], result, 0, 64, 255);
- format(string, sizeof(string), "Businessname wurde auf %s geändert",BizzInfo[bouse][bMessage]);
- }
- new string3[160];
- if(BizzInfo[bouse][bOwned] == 1)
- {
- format(string3, sizeof(string3), "[%s]\nInhaber: %s\nTeilhaber: %s\nEintrittspreis: %d$\nLevel: %d\nProdukte: %d/%d\nPreis pro Produkt: %d", BizzInfo[bouse][bMessage],BizzInfo[bouse][bOwner],BizzInfo[bouse][bExtortion],BizzInfo[bouse][bEntranceCost],BizzInfo[bouse][bLevelNeeded],BizzInfo[bouse][bProducts],BizzInfo[bouse][bMaxProducts],BizzInfo[bouse][bPriceProd]);
- Update3DTextLabelText(BizzInfo[bouse][bText],COLOR_BUYED,string3);
- }
- new string4[160];
- if(SBizzInfo[bouse-100][sbOwned] == 1)
- {
- format(string4, sizeof(string4), "[%s]\nInhaber: %s\nTeilhaber: %s\nEintrittspreis: %d$\nLevel: %d\nProdukte: %d/%d\nPreis pro Produkt: %d", SBizzInfo[bouse-100][sbMessage],SBizzInfo[bouse-100][sbOwner],SBizzInfo[bouse-100][sbExtortion],SBizzInfo[bouse-100][sbEntranceCost],SBizzInfo[bouse-100][sbLevelNeeded],SBizzInfo[bouse-100][sbProducts],SBizzInfo[bouse-100][sbMaxProducts], SBizzInfo[bouse-100][sbPriceProd]);
- Update3DTextLabelText(SBizzInfo[bouse-100][sbText],COLOR_BUYED,string4);
- }
- OnPropUpdate();
- SendClientMessage(playerid, COLOR_WHITE, string);
- }
- return 1;
- }
- if(strcmp(cmd, "/bizkasse", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- new bouse = PlayerInfo[playerid][pPbiskey];
- if (bouse == 255)
- {
- SendClientMessage(playerid, COLOR_GRAD2, " Dir gehört kein Geschäfft");
- return 1;
- }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- if (bouse >= 100)
- {
- format(string, sizeof(string), " Du hast $%d in deiner Kasse.", SBizzInfo[bouse-100][sbTill]);
- SendClientMessage(playerid, COLOR_GRAD3, string);
- }
- else
- {
- format(string, sizeof(string), " Du hast $%d in deiner Kasse.", BizzInfo[bouse][bTill]);
- SendClientMessage(playerid, COLOR_GRAD3, string);
- }
- SendClientMessage(playerid, COLOR_GRAD2, "NUTZE: /bizkasse [Betrag]");
- return 1;
- }
- new cashdeposit = strval(tmp);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "NUTZE: /bizkasse [Betrag]");
- return 1;
- }
- if (bouse >= 100)
- {
- if(cashdeposit > SBizzInfo[bouse-100][sbTill] || cashdeposit < 1)
- {
- SendClientMessage(playerid, COLOR_GRAD2, " Du hast nicht so viel Geld");
- return 1;
- }
- }
- else
- {
- if (cashdeposit > BizzInfo[bouse][bTill] || cashdeposit < 1)
- {
- SendClientMessage(playerid, COLOR_GRAD2, " Du hast nicht so viel Geld");
- return 1;
- }
- }
- if (bouse >= 100)
- {
- if(!IsPlayerInRangeOfPoint(playerid,100.0,SBizzInfo[bouse-100][sbEntranceX],SBizzInfo[bouse-100][sbEntranceY],SBizzInfo[bouse-100][sbEntranceZ]))
- {
- SendClientMessage(playerid, COLOR_GRAD2, " Du bist zu weit von deinem Geschäfft entfernt");
- return 1;
- }
- else
- {
- ConsumingMoney[playerid] = 1;
- GivePlayerMoney(playerid,cashdeposit);
- SBizzInfo[bouse-100][sbTill] -= cashdeposit;
- format(string, sizeof(string), " Du hast $%d aus deiner Kasse genommen Total: $%d ", cashdeposit,SBizzInfo[bouse-100][sbTill]);
- OnPropUpdate();
- SendClientMessage(playerid, COLOR_YELLOW, string);
- return 1;
- }
- }
- else
- {
- if (!IsPlayerInRangeOfPoint(playerid,100.0,BizzInfo[bouse][bExitX],BizzInfo[bouse][bExitY],BizzInfo[bouse][bExitZ]))
- {
- SendClientMessage(playerid, COLOR_GRAD2, " Du bist zu weit von deinem Geschäfft entfernt");
- return 1;
- }
- else
- {
- ConsumingMoney[playerid] = 1;
- GivePlayerMoney(playerid,cashdeposit);
- BizzInfo[bouse][bTill] -= cashdeposit;
- format(string, sizeof(string), " Du hast $%d aus deiner Kasse genommen Total: $%d ", cashdeposit,BizzInfo[bouse][bTill]);
- OnPropUpdate();
- SendClientMessage(playerid, COLOR_YELLOW, string);
- return 1;
- }
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/bizbank", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- new bouse = PlayerInfo[playerid][pPbiskey];
- if (bouse == 255)
- {
- SendClientMessage(playerid, COLOR_GRAD2, " Dir gehört kein Geschäfft");
- return 1;
- }
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- if (bouse >= 100)
- {
- format(string, sizeof(string), " Du hast $%d in deiner Kasse.", SBizzInfo[bouse-100][sbTill]);
- SendClientMessage(playerid, COLOR_GRAD3, string);
- }
- else
- {
- format(string, sizeof(string), " Du hast $%d in deiner Kasse.", BizzInfo[bouse][bTill]);
- SendClientMessage(playerid, COLOR_GRAD3, string);
- }
- SendClientMessage(playerid, COLOR_GRAD2, "NUTZER: /bizbank [Betrag]");
- return 1;
- }
- new cashdeposit = strval(tmp);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_GRAD2, "FEHLER: /bizbank [nutze]");
- SendClientMessage(playerid, COLOR_GRAD3, string);
- return 1;
- }
- if (cashdeposit > GetPlayerMoney(playerid) || cashdeposit < 1)
- {
- SendClientMessage(playerid, COLOR_GRAD2, " Du hast nicht so viel");
- return 1;
- }
- if (bouse >= 100)
- {
- if(!IsPlayerInRangeOfPoint(playerid,100.0,SBizzInfo[bouse-100][sbEntranceX],SBizzInfo[bouse-100][sbEntranceY],SBizzInfo[bouse-100][sbEntranceZ]))
- {
- SendClientMessage(playerid, COLOR_GRAD2, " Du bist zu weit von deinem Geschäfft entfernt");
- return 1;
- }
- else
- {
- GivePlayerMoney(playerid,-cashdeposit);
- SBizzInfo[bouse-100][sbTill] += cashdeposit;
- ExtortionSBiz(bouse-100, cashdeposit);
- format(string, sizeof(string), " Du hast $%d in die Kasse getan Total: $%d ", cashdeposit,SBizzInfo[bouse-100][sbTill]);
- OnPropUpdate();
- SendClientMessage(playerid, COLOR_YELLOW, string);
- return 1;
- }
- }
- else
- {
- if (!IsPlayerInRangeOfPoint(playerid,100.0,BizzInfo[bouse][bExitX],BizzInfo[bouse][bExitY],BizzInfo[bouse][bExitZ]))
- {
- SendClientMessage(playerid, COLOR_GRAD2, " Du bist zu weit von deinem Geschäfft entfernt");
- return 1;
- }
- else
- {
- GivePlayerMoney(playerid,-cashdeposit);
- BizzInfo[bouse][bTill] += cashdeposit;
- ExtortionBiz(bouse, cashdeposit);
- format(string, sizeof(string), " Du hast $%d in die Kasse getan Total: $%d ", cashdeposit,BizzInfo[bouse][bTill]);
- OnPropUpdate();
- SendClientMessage(playerid, COLOR_YELLOW, string);
- return 1;
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment